Muscles of the Thigh: Three Compartments, Three Nerves
Most regions of the body make you memorise muscle after muscle, nerve after nerve, until the list collapses into noise. The thigh does not. The thigh is the one place where the body draws its plan so plainly that you could almost guess it: a sheet of tough fascia divides the thigh into three sealed rooms, and each room gets exactly one nerve and exactly one job. Front room — the femoral nerve — straightens the knee. Inner room — the obturator nerve — pulls the thigh towards the midline. Back room — the tibial division of the sciatic — drives the hip back and bends the knee. Learn the rooms and the muscles fall into place by themselves, along with the pulled hamstring, the footballer's groin strain, and the reason a doctor taps just below your kneecap.
Watch a sprinter in the blocks. The gun fires and for a fraction of a second every muscle in her thigh is doing something different and doing it in the right order. The hamstrings at the back snap the hip straight and hurl the body forward. The quadriceps at the front lock the knee at exactly the moment the foot strikes, so the leg becomes a rigid strut instead of folding. The adductors on the inside hold the thigh from swinging out sideways, keeping the whole limb tracking down a narrow line. Three groups, three nerves, three jobs, and if the timing between them slips by even a few milliseconds the fastest of them — the hamstring, stretched long and contracting hard at the same instant — tears, and she pulls up clutching the back of her leg. That injury, the most common in all of sport, is a lesson in compartmental anatomy delivered at forty kilometres an hour.
One fascia, three rooms
The compartment principle is nowhere cleaner than here. The whole thigh is wrapped in a tough sleeve of deep fascia — the fascia lata — which sends three intermuscular septa inwards to attach along the linea aspera on the back of the femur. Those septa partition the thigh into an anterior (extensor) compartment, a medial (adductor) compartment and a posterior (flexor, or hamstring) compartment. Because the partitions form early in development, each compartment keeps the nerve that grew into it, and every muscle inside shares both that nerve and a broadly shared action. Anterior = femoral nerve = extend the knee. Medial = obturator nerve = adduct the hip. Posterior = tibial division of the sciatic nerve = extend the hip and flex the knee. Three sentences that carry perhaps twenty muscles between them. This is exactly the same logic that organises the arm and forearm, as described in the muscles of the arm, and once you have seen it in one limb you will recognise it in the other.
The anterior compartment: the knee's engine
The anterior compartment is supplied by the femoral nerve (L2–L4) and dominated by quadriceps femoris, the largest muscle mass in the body. Its four heads converge on one tendon: rectus femoris arises from the anterior inferior iliac spine (AIIS) and a groove above the acetabulum; vastus lateralis from the greater trochanter and the lateral lip of the linea aspera; vastus medialis from the intertrochanteric line and the medial lip of the linea aspera; and vastus intermedius from the front and lateral shaft of the femur beneath the other three. All four insert into the base and sides of the patella, and through it, by the patellar ligament, into the tibial tuberosity. Their shared action is to extend the knee — but rectus femoris is the exception that earns its name: because it alone crosses the hip, it also flexes the hip, which is why it is the head that fires hardest when you kick a ball. Vastus medialis deserves its own note. Its lowest fibres run almost horizontally (the oblique fibres, "VMO") and pull the patella medially, actively resisting the tendency of the kneecap to be dragged laterally every time the quadriceps contracts. Weaken those fibres and the patella starts to track badly against the femur, which is one of the commonest sources of anterior knee pain in the knee.
Three more muscles share the front room without belonging to the quadriceps. Sartorius is the longest muscle in the human body: a thin strap running from the anterior superior iliac spine (ASIS) obliquely across the thigh to the upper medial surface of the tibia. It flexes, abducts and laterally rotates the hip while flexing the knee — which is precisely the cross-legged position of a tailor at work, and the reason its name comes from sartor, Latin for tailor. Iliopsoas is the powerhouse: psoas major from the bodies and transverse processes of T12–L5 and iliacus from the iliac fossa, uniting to insert on the lesser trochanter of the femur. It is the most powerful flexor of the hip, and it hides a nerve-supply detail worth naming — iliacus is supplied by the femoral nerve, but psoas major receives direct branches from the anterior rami of L1–L3 before the nerve is even formed. Finally, pectineus, a short quadrangular muscle from the pecten of the pubis to the pectineal line of the femur, adducts and flexes the hip. It sits at the boundary of the front and inner rooms and behaves like it: usually femoral, sometimes obturator, occasionally both.
The medial compartment: the muscles that hold the line
The medial compartment belongs to the obturator nerve (L2–L4), which enters the thigh through the obturator foramen and is traced in detail in the femoral and obturator nerves. Adductor longus arises from the front of the pubis just below the pubic tubercle and inserts into the middle third of the linea aspera. Adductor brevis lies behind it, from the body and inferior ramus of the pubis to the upper linea aspera — and it is the muscle the two divisions of the obturator nerve split around, one passing in front of it and one behind. Adductor magnus is the giant, and it is a hybrid: its adductor part arises from the ischiopubic ramus and inserts along the whole linea aspera, supplied by the obturator nerve; its hamstring part arises from the ischial tuberosity and runs vertically to the adductor tubercle on the medial femoral condyle, supplied by the tibial division of the sciatic nerve. One muscle, two origins, two insertions, two nerves — a dual supply always worth naming out loud. Between its two parts is a gap, the adductor hiatus, through which the femoral artery and vein slip from the front of the thigh into the popliteal fossa behind the knee. Gracilis is the odd one: a thin ribbon from the pubis all the way down to the medial tibia, the only muscle of the compartment that crosses the knee, so it adducts the hip and also helps flex and medially rotate the knee. Obturator externus, from the outer surface of the obturator membrane to the trochanteric fossa, completes the group but acts mainly as a lateral rotator of the hip.
Think of the thigh as a three-storey building with a single lift shaft in each storey. The fascial septa are the fire walls: rigid, sealed, and they do not let anything cross. Each storey has its own electricity supply coming in on its own cable — femoral, obturator, tibial — so if you cut one cable, one whole floor goes dark and the other two carry on as if nothing happened. That is why nerve injuries in the thigh produce such clean, block-shaped deficits: not a scatter of weak muscles, but an entire function missing. Lose the femoral cable and the patient can walk but cannot straighten the knee, so it buckles on every step. Lose the obturator cable and the leg swings outwards. The walls that make the anatomy tidy are also what make a compartment dangerous when it bleeds — rigid walls cannot expand, and pressure inside climbs until the vessels shut.
The posterior compartment: the hamstrings
Three muscles, one origin, one nerve — and one famous exception. The hamstrings share a defining feature: they arise from the ischial tuberosity, cross both the hip and the knee, and are supplied by the tibial division of the sciatic nerve (L5–S2). Biceps femoris has two heads — a long head from the ischial tuberosity and a short head from the lateral lip of the linea aspera and the lateral supracondylar line — which unite into a tendon inserting on the head of the fibula. Note the exception carefully, because examiners love it: the long head is supplied by the tibial division, but the short head is supplied by the COMMON FIBULAR division, making it the only hamstring not on the tibial cable, and the only one that does not cross the hip. Semitendinosus, with its long cord-like tendon, runs from the ischial tuberosity to the upper medial tibia. Semimembranosus, flat and membranous at its origin, runs from the ischial tuberosity to the posterior aspect of the medial tibial condyle. Together they extend the hip — driving the body forward in walking, running and climbing stairs — and flex the knee, with biceps femoris also rotating the flexed knee laterally while semitendinosus and semimembranosus rotate it medially. The parent trunk and its two divisions, with the fibular division's notorious vulnerability at the fibular neck, are followed in the sciatic, tibial and fibular nerves.
Where three muscles from three compartments meet
On the upper medial surface of the tibia, just below the knee, three tendons arrive side by side and fuse into a broad flat expansion shaped like a goose's foot — the pes anserinus. What makes it remarkable is where the three come from: sartorius from the anterior compartment (femoral nerve), gracilis from the medial compartment (obturator nerve), and semitendinosus from the posterior compartment (tibial division). Three compartments, three different nerves, one shared insertion, and generations of students have kept the order straight with "Say Grace before Tea" — Sartorius, Gracilis, semiTendinosus, listed from front to back. The pes anserinus is not a curiosity: its underlying bursa is a classic site of medial knee pain in runners and in overweight patients, and the gracilis and semitendinosus tendons are the commonest grafts harvested to reconstruct a torn anterior cruciate ligament, precisely because they can be removed without meaningfully weakening the limb.
The knee-jerk reflex is the anterior compartment answering a question in about thirty milliseconds. Tapping the patellar ligament stretches the quadriceps; muscle spindles fire along sensory fibres into the L3–L4 segments of the spinal cord; those fibres synapse directly onto the motor neurons of the femoral nerve, and the quadriceps contracts before the brain has been told anything at all. It is a two-neuron circuit, which is why it is so fast and so reproducible — and why an absent knee jerk points sharply at L3–L4, the femoral nerve, or the muscle itself. Every compartment has its own reflex signature in the same way, and mapping them is one half of a neurological examination of the lower limb; the other half is testing the compartments' actions one nerve at a time, exactly as they are laid out in the lumbosacral plexus.
The sprinter's torn hamstring: at the end of the swing phase the hip is flexed and the knee straightening, so the hamstrings are at their longest — and at that exact moment they must contract violently to decelerate the shin. Lengthening under load is how muscle tears, which is why hamstring strains cluster at the muscle–tendon junction of biceps femoris and why they recur so stubbornly. The footballer's groin strain: a hard sideways lunge or a mistimed tackle stretches adductor longus at its narrow pubic origin, and the pain sits high in the inner thigh; it is treated conservatively, usually with rest and anti-inflammatory drugs. The wasted quadriceps: after even two weeks in a knee brace the thigh visibly thins, because the quadriceps atrophies faster than almost any muscle in the body — and until it recovers, the knee gives way on stairs. The child with hip disease who complains of knee pain: the obturator nerve supplies both the hip joint and the skin over the medial knee, so the brain misreads the source, and a child limping with a painful "knee" may in fact have a diseased hip.
- Anterior (extensor) compartment = FEMORAL nerve (L2–L4): quadriceps femoris, sartorius, iliopsoas and pectineus.
- Quadriceps: rectus femoris (AIIS), vastus lateralis, medialis and intermedius (femur) → patella → patellar ligament → tibial tuberosity; all extend the knee.
- Rectus femoris is the only head crossing the hip, so it also flexes it; the oblique fibres of vastus medialis resist lateral patellar dislocation.
- Sartorius (ASIS → medial tibia) is the longest muscle in the body: flexes, abducts and laterally rotates the hip and flexes the knee — the tailor's position.
- Iliopsoas (psoas major + iliacus → lesser trochanter) is the most powerful hip flexor — psoas is supplied DIRECTLY by the L1–L3 anterior rami.
- Pectineus (pecten pubis → pectineal line) adducts and flexes the hip: femoral, sometimes obturator — a border muscle in both position and supply.
- Medial (adductor) compartment = OBTURATOR nerve (L2–L4): adductor longus, brevis and magnus, gracilis and obturator externus.
- Adductor magnus is dual-supplied: the adductor part (ischiopubic ramus → linea aspera) by the obturator; the hamstring part (ischial tuberosity → adductor tubercle) by the TIBIAL division.
- The adductor hiatus in adductor magnus transmits the femoral artery and vein from the thigh into the popliteal fossa.
- Gracilis is the only adductor crossing the knee, so it also flexes and medially rotates it.
- Posterior (hamstring) compartment = TIBIAL division of the SCIATIC nerve (L5–S2): biceps femoris, semitendinosus, semimembranosus — ischial tuberosity → around the knee; extend the hip, flex the knee.
- THE exception: the SHORT head of biceps femoris arises from the linea aspera and is supplied by the COMMON FIBULAR division — and does not cross the hip.
- Calling adductor magnus a purely obturator muscle. Its hamstring part comes from the ischial tuberosity and is supplied by the tibial division of the sciatic nerve — the classic dual supply of the thigh.
- Assuming every hamstring is on the tibial division. The short head of biceps femoris is common fibular — which is why a fibular nerve lesion can weaken knee flexion slightly as well as causing foot drop.
- Treating all four quadriceps heads as identical. Only rectus femoris crosses the hip (so only it flexes the hip), and only vastus medialis has oblique fibres that stabilise the patella medially.
A patient has weakness of hip adduction and reduced sensation over the medial thigh, but hip extension and knee flexion are normal. Which single muscle would you expect to be only PARTIALLY weakened, because it has a dual nerve supply?
- The fascia lata and its three septa divide the thigh into anterior, medial and posterior compartments — one nerve and one job each.
- Anterior/FEMORAL: quadriceps (four heads → patella → tibial tuberosity, extend the knee; rectus femoris also flexes the hip), sartorius, iliopsoas and pectineus.
- Medial/OBTURATOR: adductors longus, brevis and magnus, gracilis and obturator externus — with adductor magnus dual-supplied and pierced by the adductor hiatus.
- Posterior/TIBIAL division: biceps femoris, semitendinosus and semimembranosus extend the hip and flex the knee — except the short head of biceps femoris (common fibular). Pes anserinus = Say Grace before Tea.
- Drake RL, Vogl AW, Mitchell AWM. Gray's Anatomy for Students — Lower limb: compartments of the thigh.
- Moore KL, Dalley AF, Agur AMR. Clinically Oriented Anatomy — Anterior, medial and posterior thigh muscles.
- Netter FH. Atlas of Human Anatomy — Muscles of the thigh: anterior, medial and posterior views.
- Last RJ. Last's Anatomy: Regional and Applied — The front, medial side and back of the thigh.
- Snell RS. Clinical Anatomy by Regions — Hamstring strains, adductor injury and the pes anserinus.
- TeachMeAnatomy — Muscles of the Anterior, Medial and Posterior Thigh.

