Donate
A mosque prayer niche lit by candlelight
Sira Nabawiyya

Chapter 18 of 22 · 627 CE / 5 AH

The Battle of the Trench (Al-Ahzab) and Banu Qurayzah

غزوة الخندق وبنو قريظة

A confederation of tribes marched to erase Madinah from the map — and a trench, an idea never before seen in Arabia, saved the city.


Read

يَا أَيُّهَا الَّذِينَ آمَنُوا اذْكُرُوا نِعْمَتَ اللَّهِ عَلَيْكُمْ إِذْ جَاءَتْكُمْ جُنُودٌ فَأَرْسَلْنَا عَلَيْهِمْ رِيحًا وَجُنُودًا لَمْ تَرَوْهَا

O you who believe, remember the favor of Allah upon you when armies came against you and We sent upon them a wind and armies you did not see.

— Quran 33:9

A Confederation Forms

By the fifth year after the Hijrah, Quraysh had failed twice to crush the young Muslim community by force. So they tried something larger. Meccan leaders reached out to the powerful Jewish tribe of Banu al-Nadir, exiled from Madinah after their earlier treachery, and together they rallied a sweeping coalition: Quraysh, the nomadic Ghatafan, and several smaller allied tribes, amounting to roughly ten thousand fighters. It was the largest force ever assembled against the Muslims, an alliance built on one shared goal — to end the Prophet ﷺ and his message in a single, overwhelming campaign against Madinah itself.

Salman's Trench

Word of the approaching army reached the Prophet ﷺ in time to prepare. Madinah was naturally shielded on most sides by rocky terrain and dense palm groves, but one open stretch to the north left it exposed. In the council that followed, Salman al-Farisi, a Persian companion familiar with the defensive tactics of his homeland, suggested digging a khandaq — a deep trench — along that vulnerable flank. It was a method unknown to Arabian warfare, where battles were traditionally fought face to face. The Prophet ﷺ approved the plan, and the whole community, including the Prophet ﷺ himself carrying earth alongside his companions, dug through the flank in a matter of days.

Siege and Endurance

When the confederate armies arrived, they found themselves stopped cold by a ditch their cavalry could not cross. What followed was a grinding siege of roughly a month, fought less with swords than with nerves. The Madinan winter turned bitterly cold, food grew scarce, and only a handful of enemy riders ever managed to leap the trench, turned back each time in close skirmishes. Adding to the danger, the Jewish tribe of Banu Qurayzah inside Madinah, bound to the Muslims by treaty, broke their pact and opened secret talks with the besiegers, threatening the city from within just as it strained from without.

The Wind and the Retreat

As the siege dragged on, cracks formed among the confederates themselves — old rivalries between Quraysh and Ghatafan resurfaced, supplies dwindled, and morale collapsed. Then, as the Quran itself records, a fierce and freezing wind swept the enemy camp by night, overturning tents, scattering cooking fires, and terrifying men and animals alike. Believing the fight no longer worth the misery, the confederate armies broke camp and withdrew in disarray, ending the siege without a decisive pitched battle. The Prophet ﷺ described it afterward as Quraysh's final large-scale attempt to destroy Islam by force; they would never again march on Madinah in such strength.

The Reckoning with Banu Qurayzah

The moment the siege lifted, the Prophet ﷺ turned to the matter of Banu Qurayzah's betrayal, a breach that had endangered every soul in Madinah during its most vulnerable hour. He besieged their fortress until they agreed to accept judgment from Sa'd ibn Mu'adh, a leader of the Aws whom Banu Qurayzah themselves had proposed as an acceptable arbiter, trusting his tribe's old alliance with them. Sa'd, already wounded from the siege and judging strictly according to the Torah's own law of war for a besieged people who had aided an enemy, ruled that the combatant men be executed and the women and children spared and resettled. The Prophet ﷺ affirmed that Sa'd's judgment matched the ruling of God from above the seven heavens.

A Turning Point

The Battle of the Trench, also called Al-Ahzab after the 'confederates' named in the Quran, marked a hinge in the Prophet's ﷺ mission. Madinah had faced its gravest external threat and survived through ingenuity, unity, and endurance rather than raw numbers. From this point on, the initiative shifted decisively toward the Muslims. Quraysh's coalition had spent its strength and failed; within two years, the Prophet ﷺ would be negotiating from a position secure enough to seek not war but peace.

In the cold nights behind that trench, a young community learned that patience and unity could outlast even the largest army raised against it.

Sira reports can differ in chronology and detail. Read narrative claims with the cited Quranic passage and the site's editorial methodology in view.

Your next step

Continue your journey at Baby Steps Islam

Visit Baby Steps Islam