Most nerves originating from the sacral plexus leave the pelvic cavity by passing through the greater sciatic foramen inferior to the piriformis muscle, and enter the gluteal region of the lower limb. Other nerves leave the pelvic cavity using different routes; a few nerves do not leave the pelvic cavity and course directly into the muscles in the pelvic cavity. Finally, two nerves that leave the pelvic cavity through the greater sciatic foramen loop around the ischial spine and sacrospinous ligament and pass medially through the lesser sciatic foramen to supply structures in the perineum and lateral pelvic wall.