The nerve to the quadratus femoris (L4 to S1) and the nerve to the obturator internus (L5 to S2) are small motor nerves that originate from the sacral plexus. Both nerves pass through the greater sciatic foramen inferior to the piriformis muscle and enter the gluteal region (Fig. 6.36 and Table 6.1):