The inguinal canal is a passage through the lower anterior abdominal wall that allows structures to pass between the abdomen and scrotum in males or labia in females. It contains the spermatic cord in males which includes the vas deferens, blood vessels and nerves. The inguinal canal has anterior and posterior walls formed from the external oblique muscle and fascia transversalis respectively. It transmits the ilioinguinal nerve in both sexes. Inguinal hernias occur when abdominal contents bulge through weak areas of the inguinal canal walls.