The ilioinguinal nerve is a branch of the first lumbar nerve (L1). It separates from the first lumbar nerve along with the larger iliohypogastric nerve. It emerges from the lateral border of the psoas major just inferior to the iliohypogastric, and passes obliquely across the quadratus lumborum and iliacus. The ilioinguinal nerve then perforates the transversus abdominis near the anterior part of the iliac crest, and communicates with the iliohypogastric nerve between the transversus and the internal oblique muscle.
It then pierces the internal oblique muscle, distributing filaments to it, and then accompanies the spermatic cord (in males) or the round ligament of uterus (in females) through the superficial inguinal ring. Its fibres are then distributed to the skin of the upper and medial part of the thigh, and to the following locations in the male and female: