The anus, in anatomy, is the external opening of the rectum. It is controlled by sphincter muscles. Feces are expelled from the body through the anus during the act of defecation, which is the primary function of the anus. Most animals — from primitive worms all the way up to humans — have a tubular gut, with a mouth at one end and an anus at the other. In general, the anus is simply the exit point for matter passing through the digestive tract.
Anatomy and function of the human anus
The human anus is situated between the buttocks, posterior to the perineum. It has two anal sphincters, one internal, the other external. These hold the anus closed until the body is ready to defecate.
When the rectum is full the increase in intrarectal pressure forces the walls of the anal canal apart allowing the fecal matter to enter the canal. The rectum shortens as material is forced into the anal canal and peristaltic waves propel the feces out of the rectum. The internal and external sphincters of the anus allow the feces to be passed by muscles pulling the anus up over the exiting feces.
As the anus has a relatively high concentration of nerve endings, it is an erogenous zone, and plays a role in sexuality. For this reason (among others), Sigmund Freud's theory of psychosexual development described an "anal stage", hypothesizing that toddlers derive pleasure from retaining and expelling feces. This is the source of the (derogatory) term "anal-retentive".
Anal sex can be pleasurable for both the insertive partner and the receptive partner. The anus contains many of the same kinds of nerves as the penis or clitoris. For females, pleasure derived from anal intercourse is also thought to be related to the shared wall between the rectum and the vagina as well as the G-spot. For males, the tightness of the anus is often said to be a source of pleasure in penetrative anal sex, while the presence of the prostate gland near the rectal wall is generally seen as a source of pleasure during receptive anal intercourse.