Region · Lower limb
Muscles of the leg: anterior, lateral and posterior compartments
The muscles of the leg sit in three compartments, anterior, lateral and posterior, each with its own nerve and job. Learn how they move the ankle, foot and toes.
In anatomy, the "leg" is only the segment between the knee and the ankle. Its muscles are packed into three compartments, anterior, lateral and posterior, and the muscles of each compartment share a nerve and a main job: lifting the foot, turning the sole outwards, or pushing the body forward off the toes.
At a glance
| Muscle | Origin | Insertion | Action |
|---|---|---|---|
| Tibialis anterior | Tibia | First metatarsal bone, Medial cuneiform bone | Dorsiflexes and inverts the foot |
| Extensor digitorum longus | Tibia, Fibula, Interosseous membrane | Middle and distal phalanges of toes 2–5 | Extends the lateral four toes; dorsiflexes the foot |
| Extensor hallucis longus | Fibula | Proximal phalanx of great toe | Extension of the extremities |
| Fibularis longus | Fibula | First metatarsal bone, Medial cuneiform bone | Everts and plantar flexes the foot |
| Fibularis brevis | Fibula | Fifth metatarsal bone | Everts the foot |
| Gastrocnemius | Femur | Calcaneus | Plantar flexion of the ankle; flexion of the knee |
| Soleus | Fibula, Tibia | Calcaneus | Plantar flexes the ankle |
| Tibialis posterior | Tibia, Fibula, Interosseous membrane | Navicular bone, Cuneiform bones, Metatarsals 2–4 | Plantar flexes and inverts the foot |
| Flexor digitorum longus | Tibia | Distal phalanx of second toe, Distal phalanx of third toe, Distal phalanx of fourth toe, Distal phalanx of fifth toe | Finger flexion |
| Flexor hallucis longus | Fibula | Distal phalanx of great toe | Finger flexion |
From the anatomical data behind Anatomy Atlas 3D (Z-Anatomy, CC BY-SA 4.0, reviewed). Names link to the detailed page when there is one.
How they are organized
The tibia and the fibula run side by side, joined by a sheet of tissue called the interosseous membrane. Together with two partitions of deep fascia, the anterior and posterior intermuscular septa, they divide the leg into closed spaces. This page covers ten muscles: three in front, two on the side and five at the back.
Anterior compartment
The tibialis anterior, the extensor digitorum longus and the extensor hallucis longus lie in front of the interosseous membrane, on the outer side of the shin. Their tendons cross the front of the ankle under bands of fascia (the extensor retinacula) that keep them from bowstringing. All three are supplied by the deep fibular nerve. Many people also have a small fourth muscle here, the fibularis tertius, but its size varies and in some it is absent.
Lateral compartment
The fibularis longus and fibularis brevis (also called the peroneus longus and brevis) cover the outer side of the fibula. Their tendons curve behind the lateral malleolus, the bony bump on the outside of the ankle. They are supplied by the superficial fibular nerve.
Posterior compartment
The back of the leg is split into a superficial and a deep group by a layer of fascia:
- Superficial group: the gastrocnemius and the soleus. Together they are called the triceps surae (the gastrocnemius has two heads, the soleus one) and they share the calcaneal, or Achilles, tendon. A thin plantaris muscle often runs between them, though some people lack it.
- Deep group: the tibialis posterior, the flexor digitorum longus and the flexor hallucis longus. Their tendons pass behind the medial malleolus, on the inside of the ankle, into the sole. The small popliteus, behind the knee, belongs to this deep layer too.
Both groups are supplied by the tibial nerve.
What they do together
Each compartment produces a recognizable movement of the foot:
- Anterior compartment: dorsiflexion. These muscles lift the front of the foot and extend the toes. They work hardest when your heel strikes the ground, lowering the forefoot smoothly instead of letting it slap down, and when you lift the toes clear of the ground during the swing phase of walking.
- Lateral compartment: eversion. The fibular muscles turn the sole outwards and help steady the ankle when you stand on uneven ground.
- Posterior compartment: plantar flexion. The triceps surae is the main engine for rising onto the toes, walking uphill, running and jumping. The deep group adds plantar flexion, flexes the toes and supports the arches of the foot. The tibialis posterior is the main invertor, turning the sole inwards.
The compartments also work as pairs. The tibialis anterior and the fibularis longus both reach the inner side of the foot, near the medial cuneiform and the first metatarsal, one from above and one from below, through the sole. Teachers often call this pair a stirrup under the arch. The gastrocnemius also crosses the knee, so it helps flex the knee, while the soleus acts on the ankle alone and works almost constantly to keep you upright when you stand.
How to learn them
Learn the leg by compartment, not muscle by muscle. For each compartment, memorize four things: its members, its nerve, its main movement and where its tendons cross the ankle. Once that frame is in place, the details of each muscle fit into it.
Two mnemonics help with the tendons at the ankle:
- In front of the ankle, from medial to lateral: "Tom Has Very Nice Dancing Pants". Tibialis anterior, extensor Hallucis longus, anterior tibial Vessels, deep fibular Nerve, extensor Digitorum longus, Peroneus (fibularis) tertius.
- Behind the medial malleolus, from front to back: "Tom, Dick And Very Nervous Harry". Tibialis posterior, flexor Digitorum longus, posterior tibial Artery, tibial Vein, tibial Nerve, flexor Hallucis longus.
A practical exam usually asks you to point at a muscle or a tendon and name it, or to say which compartment and nerve it belongs to. In the app, peel the superficial muscles to reveal the deep posterior group under the soleus, isolate a single muscle to follow its tendon into the foot, then switch the quiz to the lower limb and find each muscle by tapping it on the 3D body. The bones of the foot are worth learning at the same time, because most of these tendons end on them.
Frequently asked questions
How many compartments does the leg have?
Three: anterior, lateral and posterior. The posterior compartment is further split into a superficial and a deep group.
Which muscles make up the calf?
Mainly the gastrocnemius and the soleus, the triceps surae, which share the Achilles tendon. The deep flexors lie underneath them.
Which nerve supplies each compartment?
The deep fibular nerve supplies the anterior compartment, the superficial fibular nerve the lateral compartment and the tibial nerve the posterior compartment.
Is the thigh part of the leg?
Not in anatomical terms. The thigh runs from hip to knee and the leg from knee to ankle. Everyday language uses "leg" for the whole limb.


