Rectal anatomy, showing the rectum, anus, mesorectum, surrounding lymph nodes and sphincter muscles

The rectum and anus are the final part of the digestive system. The rectum stores stool until it leaves the body through the anus. The sphincter muscles help control bowel movements. Surrounding the rectum is fatty tissue called the mesorectum, which contains blood vessels and lymph nodes. These lymph nodes are part of the body's immune system.