🕌 Migration & Medinan Foundation

Battle of the Trench (Al-Khandaq)

غزوة الخندق

The largest coalition ever assembled against the Muslims — 10,000 soldiers — surrounded Madinah. On the suggestion of Salman al-Farisi RA, the Muslims dug a trench on the vulnerable side. After 27 days of siege, a divine windstorm and internal discord broke the coalition.

627 CEShawwal, 5 AHMadinah

The Account

The Coalition (Al-Ahzab)

The Jewish tribe of Banu al-Nadir — expelled from Madinah earlier for plotting against the Prophet ﷺ — travelled to Mecca and gathered an unprecedented coalition:

- Quraysh sent 4,000 warriors under Abu Sufyan - Ghatafan sent 6,000 warriors - Other allied tribes added more

Total: approximately 10,000 soldiers — the largest force ever assembled against the Muslims.

Allah called them al-Ahzab (the Confederates) and dedicated a full Surah (Surah Al-Ahzab) to this event.


The Trench

The Prophet ﷺ consulted his companions. Salman al-Farisi RA — a Persian companion who had converted to Islam — suggested digging a trench (khandaq) along the undefended northern flank of Madinah (the other sides were protected by natural barriers). This strategy was unknown to the Arabs.

The Prophet ﷺ approved and every companion was assigned a stretch of trench to dig. The Prophet ﷺ worked alongside them — carrying earth and rock, his stomach pressed against a stone from hunger. He recited:

"O Allah — there is no good but the good of the Hereafter. So forgive the Ansar and the Muhajirun."

The companions responded:

"We are those who pledged to Muhammad — jihad forever, as long as we live."

The trench was dug in approximately 6 days — just before the army arrived.


The Siege — 27 Days

The coalition arrived and was stopped by the trench — a tactic they had no answer for. They camped and waited, launching occasional arrows and attempting to cross.

The greatest crisis: Banu Qurayza, the last remaining Jewish tribe in Madinah, broke their covenant with the Muslims and declared support for the coalition — threatening the Muslims from within.

The companions endured intense cold, hunger, and fear. Allah describes their state:

*"When they came upon you from above you and from below you, and when eyes shifted, and hearts reached the throats, and you assumed about Allah [various] assumptions."* (Al-Ahzab: 10)


The Divine Intervention

After 27 days, Nu'aym ibn Mas'ud — a man from Ghatafan who had secretly accepted Islam — engineered discord between Banu Qurayza and the coalition through strategic misdirection.

Then Allah sent a bitter windstorm (in Sahih al-Bukhari: rih — a cold wind) that overturned their pots, uprooted their tents, and extinguished their fires. Combined with the internal discord, Abu Sufyan commanded the withdrawal:

"O Quraysh — leave! By God I am leaving!"

The Prophet ﷺ, informed by Jibril that the coalition had left, said:

"Now we will march against them and they will not march against us."


After the Trench: Banu Qurayza

The Prophet ﷺ immediately turned to deal with Banu Qurayza, who had betrayed the covenant during the siege. After a 25-day siege, they surrendered and asked for the judgement of Sa'd ibn Mu'adh RA — their former ally.

Sa'd RA, dying from a wound suffered at the Trench, gave his judgement: the fighting men are to be killed, the women and children taken captive, the wealth distributed.

The Prophet ﷺ said: "You have judged according to the judgement of Allah above the seven heavens."

Sa'd ibn Mu'adh RA died from his wound shortly after, and the Prophet ﷺ said: "The Throne of the Most Merciful shook at the death of Sa'd ibn Mu'adh."

Hadith References

"The Prophet ﷺ said after the coalition left: "Now we will march against them and they will not march against us. We are going to them.""

Sahih al-Bukhari, 4110Sahih

Relevance: Marks the turning point — after Khandaq, the Muslims were on the offensive, Quraysh never attacked Madinah again

"The Prophet ﷺ said: "The Throne of the Most Merciful shook at the death of Sa'd ibn Mu'adh.""

Sahih al-Bukhari, 3803; Sahih Muslim, 2466Sahih

Relevance: The extraordinary honour given to Sa'd ibn Mu'adh RA at his death

Scholar Views

Ibn al-Qayyimd. 751 AH

"The Battle of the Trench shows the maturity of the Muslim state. At Badr they fought 300 vs 1,000. At Uhud, 700 vs 3,000. At the Trench, they endured 700 vs 10,000 — without a single pitched battle — through strategy, patience, and reliance on Allah."

Zad al-Ma'ad, Vol. 3, Khandaq chapter

Ibn Kathird. 774 AH

"The shaking of the Divine Throne at the death of Sa'd RA is narrated in Sahih Muslim and al-Bukhari. It indicates that the degree of one's love for Allah and service to His religion determines one's standing — Sa'd was among the greatest despite never being in the first converts."

Al-Bidaya wa'l-Nihaya, Vol. 4

Key Lessons

  • Taking counsel (shura) and accepting the best idea regardless of its source — Salman was a Persian, not Arab — is from the Prophet's ﷺ sunnah
  • The Prophet ﷺ working the trench alongside his companions shows that Islamic leadership means serving, not commanding from comfort
  • The Divine intervention (windstorm) after human means were exhausted shows that reliance on Allah is not passive — you exhaust all means, then expect Allah's help
  • Sa'd ibn Mu'adh RA's judgement on Banu Qurayza was based on their own Torah's law of war — and confirmed by the Prophet ﷺ as Allah's judgement

Sources

  • Ar-Raheeq Al-Makhtum — Safiur Rahman Mubarakpuri
  • Al-Bidaya wa'l-Nihaya — Ibn Kathir
  • Zad al-Ma'ad — Ibn al-Qayyim
khandaqtrenchsalmancoalitionbanu qurayzasad ibn muadh

← Back to Seerah Timeline