The anus is the end of the line for the alimentary canal. The anal canal lies to the north of the anus and the light of day is to the south. During defecation, waste passes from the rectum, through the anal canal, and ultimately out through the anus.
External Sphincter of the AnusIt's the external anal sphincter's job to keep the exit closed throughout the day. If you've ever made a conscious effort to close the flood gates during a bout of diarrhea, the external anal sphincter is the muscle you were controlling.
Internal Sphincter of the AnusThe internal anal sphincter is an involuntary muscle, which means it does its job on its own without any orders from you. What is its job? The internal anal sphincter helps keep poop from leaving the body before its time and also helps escort it out when the time is right.
To learn more about colorectal anatomy, please take a look at the Anatomy of the Large Intestine gallery.
Source: The Muscles and Fasciae of the Perineum. Gray's Anatomy of the Human Body. 3 Sep. 2006 [http://education.yahoo.com/reference/gray/subjects/subject?id=120].