The superior gluteal nerve, formed by branches from the dorsal divisions of L4 to S1, leaves the pelvic cavity through the greater sciatic foramen superior to the piriformis muscle and supplies muscles in the gluteal region—gluteus medius, gluteus minimus, and tensor fasciae latae (tensor of fascia lata) muscles.