Vault29
Back to the timeline

The Medinan years

627 CE • 5 AH

The Battle of the Trench (al-Khandaq)

Medina

Illustration of a long trench across barren ground at dusk

Facing a large confederate army, the Muslims dig a trench around the exposed side of Medina. The siege fails, and it marks a turning point in the city's safety.

In the fifth year after the Hijra, the people of Medina learned that a large alliance was marching against them. Quraysh had joined with several allied tribes to form one great confederate army, far larger than the Muslims had faced before. The aim was clear. They wanted to put an end to the young community in Medina. For the Muslims, who were fewer in number, the news was heavy. This was not a raid that would soon turn back. It was a force gathered to overwhelm the city, and everyone knew the danger was real.

Medina was protected on some sides by thick clusters of date palms and by houses built close together, which made an attack from those directions hard. But one open side lay exposed, and through it cavalry could pour in. On the advice of Salman al-Farisi, the decision was made to dig a long trench across that gap, wide and deep enough that horses could not cross it. The whole community took up the work together, and the Prophet ﷺ dug alongside them. They labored in cold and hunger, tying stones against their stomachs to bear the pangs, and kept their spirits up by chanting verses of encouragement as they worked.

When the confederate army arrived, they were stopped short. They had expected open ground and instead found a trench they could not pass. So they settled into a siege, camped outside the city, hoping to break the Muslims through pressure and fear. The days stretched on. Surah al-Ahzab, named for these confederates, describes how hard that time was, when hearts reached the throats and the believers were shaken. Yet they held. Then a fierce wind and bitter cold swept through the camp of the besiegers, tearing down their tents and putting out their fires, and in the end the great army broke apart and withdrew.

The failure of this siege changed the position of Medina for good. The largest force the enemies of Islam had gathered came and went, and the city still stood. After this, Quraysh never again mounted such an assault against the Muslims. The long struggle had turned in their favor. What the people of Medina remembered most was not a clash of swords, since there was no full battle, but their patience, their unity in the trench, and their trust that relief would come. That is why this moment is held up as a turning point, the day the threat was lifted and the community could begin to feel safe again.

Sources

Qur'an
Qur'an 33 (Surah al-Ahzab)
Classical history
Ibn Hisham, al-Sira al-Nabawiyya

Seed content, under scholarly review.