The anal canal is part of the anal triangle in the perineum. It is a continuation of the rectum at the pelvic diaphragm and opens below at the anus. Internally, the lining of the upper part of the canal is derived from the hindgut, while the inferior part is derived from skin. The mucosa of the upper part of the canal is formed into a number of ridges (anal columns) deep to which are terminal branches of the superior rectal vessels. This is the site of haemorrhoids in cases of portal hypertension. Smooth muscle in the wall of the canal forms the involuntary internal anal sphincter.