The rectum is a muscular tube about 5 in. (12.7 cm) long that is at the end of the large intestine (colon). The rectum connects the colon to the anus, which is the opening where stool exits the body.
The internal and external anal sphincters are rings of muscle at the opening of the anus. The sphincters keep the anus closed as stool collects in the rectum. Eventually the pressure on the rectum wall causes the internal anal sphincter to relax. Conscious control over the external anal sphincter allows stool to pass out of the body through the anus.