Stool, or solid waste, leaves the body through the anus. Two ring-like muscles open and close the anal opening to let stool pass through the body. These muscles are called sphincter muscles.