The piriformis muscle () is a flat, pyramidally-shaped muscle in the gluteal region of the lower limbs. It is one of the six muscles in the lateral rotator group. The piriformis muscle has its origin upon the front surface of the sacrum, and inserts onto the greater trochanter of the femur. Depending upon the given position of the leg, it acts either as external (lateral) rotator of the thigh or as abductor of the thigh. It is innervated by the piriformis nerve. Structure The piriformis is a flat muscle, and is pyramidal in shape. Origin The piriformis muscle originates from the anterior (front) surface of the sacrum by three fleshy digitations attached to the second, third, and fourth sacral vertebra. It also arises from the superior margin of the greater sciatic notch, the gluteal surface of the ilium (near the posterior inferior iliac spine), the sacroiliac joint capsule, and (sometimes) the sacrotuberous ligament (more specifically, the superior part of the pelvic surface of this ligament). Insertion The muscle inserts onto the greater trochanter of the femur (its tendon often unites with the tendons of the superior gemellus, inferior gemellus, and obturator internus muscles prior to insertion). Innervation The piriformis muscle is innervated by the piriformis nerve. Relations The posterior aspect of the muscle lies againt the sacrum. The anterior surface of the muscle is related to the rectum (especially on the left side of the body), and the sacral plexus. The muscle lies almost parallel with the posterior margin of the gluteus medius. It is situated partly within the pelvis against its posterior wall, and partly at the back of the hip joint. It exits the pelvis through the greater sciatic foramen superior to the sacrospinous ligament. Variation In around 80% of the population, the sciatic nerve travels below the piriformis muscle. In 17% of people, the piriformis muscle is pierced by parts or all of the sciatic nerve. Several variations occur, but the most common type of anomaly (81% of anomalies) is the Beaton's type B which is when the common peroneal nerve pierces the piriformis muscle. It may be united with the gluteus medius, send fibers to the gluteus minimus, or receive fibers from the superior gemellus. It may have one or two sacral attachments; or it may be inserted into the capsule of the hip joint. Function The piriformis muscle is part of the lateral rotators of