The Battle of the Trench (al-Khandaq): When an Idea Defeated an Army (UK Guide)

By Eaalim Institute on 4/28/2026

The Battle of the Trench — when an idea defeated an army

In Shawwāl 5 AH (March 627 CE), the Prophet Muhammad ﷺ and the Muslim community of Madinah faced what was, on paper, an unwinnable confrontation. A coalition (al-Aḥzāb — "the confederates") of approximately 10,000 fighters from Quraysh, the Ghaṭafān tribes, and various smaller allies had assembled to march on Madinah and destroy the Muslim community. The Muslim defenders numbered approximately 3,000.

What followed — the Battle of al-Khandaq, "the Battle of the Trench" — became one of the most strategically distinctive engagements in early Islamic history. No major battle was fought; the coalition was defeated by a single defensive engineering decision combined with divine intervention.

The strategic problem

Madinah was an oasis city surrounded on three sides by basalt lava fields (al-ḥarrah) that made cavalry approach effectively impossible. Only the northern approach was open. A defensive line on the northern frontier, properly held, could neutralise the entire coalition\'s numerical advantage by funnelling them into a single attack vector.

The idea of digging a defensive trench was not Arab military tradition. It came from Salmān al-Fārisī (RA), the Persian Companion of the Prophet ﷺ, drawing on Persian military engineering practice. He proposed it; the Prophet ﷺ approved it; the Companions began digging.

The trench

The trench ran approximately 5.5 km along the northern approach to Madinah. It was approximately 5 metres deep and 9 metres wide — far too wide for cavalry to leap and far too deep for infantry to easily descend and re-ascend under fire. The Muslim community dug the entire trench in approximately 6 days, working in shifts including the Prophet ﷺ himself, who joined the digging and shared the famine conditions of the workers.

The classical sources preserve several incidents from the digging — including the famous moment when an unbreakable rock was struck by the Prophet ﷺ\'s own hand and shattered, with the Prophet ﷺ seeing in the sparks visions of the future Muslim conquests of Persia, Byzantium and Yemen.

The siege

The coalition arrived to find the trench in place. They could not cross. They besieged Madinah for approximately 27 days. Several individual cavalry attempts were made to leap the trench at narrower points; one Quraysh leader, ʿAmr ibn ʿAbd Wudd, succeeded in crossing — and was killed by ʿAlī ibn Abī Ṭālib (RA) in single combat, one of the most famous duels in early Islamic history.

The siege created severe pressure on Madinah. Food was short, the weather was cold, and a parallel internal threat developed when the Jewish tribe of Banū Qurayẓah within Madinah broke their treaty with the Muslims and opened secret negotiations with the besieging coalition. The Muslim position became precarious in multiple directions simultaneously.

The divine intervention

After 27 days of unsuccessful siege, with internal coalition tensions rising and supply lines stretched, a sudden severe winter storm struck the coalition camp. Tents were torn down, fires extinguished, animals scattered. Surah Al-Aḥzāb 33:9 preserves the moment:

﴾يَا أَيُّهَا الَّذِينَ آمَنُوا اذْكُرُوا نِعْمَةَ اللَّهِ عَلَيْكُمْ إِذْ جَاءَتْكُمْ جُنُودٌ فَأَرْسَلْنَا عَلَيْهِمْ رِيحًا وَجُنُودًا لَّمْ تَرَوْهَا﴿
"O you who have believed, remember the favour of Allah upon you when armies came to [attack] you and We sent upon them a wind and armies [of angels] you did not see."

Abū Sufyān, the Quraysh commander, gave the order to break camp and retreat. The coalition disintegrated. Madinah survived without a major battle being fought.

The aftermath — Banū Qurayẓah

The Prophet ﷺ then addressed the internal threat. The Banū Qurayẓah — the Jewish tribe that had broken its treaty during the siege — were besieged in their own fortresses. After their surrender, the dispute was referred to a third-party arbitrator (Saʿd ibn Muʿādh, RA, who was himself dying of a wound from the trench). Saʿd applied the punishment specified in the Banū Qurayẓah\'s own Torah for their level of treachery — execution of the fighting men. The episode is one of the most carefully discussed in classical Islamic sources, and the specific application to a treaty-breaking tribe in wartime should not be generalised to any contemporary Muslim-Jewish relationship.

Lessons for British Muslim families

1. A foreign idea can save the community

The trench was a Persian engineering technique brought into Arab warfare by Salmān al-Fārisī (RA). The Prophet ﷺ accepted it without prejudice against its non-Arab origin. British Muslim families should similarly be open to good ideas regardless of the cultural source — including from the wider British and global non-Muslim contexts in which they live.

2. Engineering and strategy are part of Islamic responsibility

The trench was not a miracle; it was a logistical and engineering project. The miracle came at the end (the storm) — but the work that preceded it was human. British Muslim families should not separate "spiritual" effort from "practical" effort; both are part of Islamic responsibility.

3. Internal threats and external threats often arrive together

The Banū Qurayẓah broke their treaty precisely when the external siege was at its most intense. British Muslim communities should expect that pressures arrive in combination — financial pressure during health crises, family pressure during career challenges, political pressure during community building.

4. Allah\'s help comes at the moment of maximum effort

The storm did not arrive on day 1 of the siege. It arrived on day 27, after 27 days of full Muslim effort and prayer. The lesson — including for British Muslim families enduring long trials — is that divine help is real, and arrives at its appointed time, after the human effort has been completed.

Frequently asked questions

Where to go next

For more on the Madinan military history, see our guides on The Battle of Tabūk, The Muslim Struggle Between Makkah and Madinah, and Muslim Life in Madinah. To study the sirah one-to-one with an Al-Azhar-graduate teacher, book a free trial lesson.

ابدأ رحلتك مع إي عاليم اليوم!

ابدأ تجربتك المجانية
Facebook
Pinterest
X
LinkedIn
Instagram
Share
Share

Frequently Asked Questions

Shawwāl 5 AH (March 627 CE). It is also known as al-Khandaq ("the Trench") and as the Battle of al-Aḥzāb ("the Confederates") because the attacking force was a coalition of multiple tribes.

Approximately 10,000 fighters from Quraysh, the Ghaṭafān tribes, and various smaller allies. The Muslim defenders numbered approximately 3,000.

Salmān al-Fārisī (RA), the Persian Companion of the Prophet ﷺ, drawing on Persian military engineering practice. The Prophet ﷺ approved the proposal; the Muslim community dug the entire 5.5 km trench in approximately 6 days.

Approximately 5.5 km long, 5 metres deep, and 9 metres wide — far too wide for cavalry to leap and far too deep for infantry to easily descend and re-ascend under fire.

Several individual cavalry attempts were made to leap the trench at narrower points; one Quraysh leader (ʿAmr ibn ʿAbd Wudd) succeeded and was killed by ʿAlī ibn Abī Ṭālib (RA) in single combat. No major battle was fought; the coalition could not cross the trench.

After 27 days of unsuccessful siege, a sudden severe winter storm struck the coalition camp — tents torn down, fires extinguished, animals scattered. Surah Al-Aḥzāb 33:9 preserves the moment: "We sent upon them a wind and armies you did not see." The coalition disintegrated.

During the siege, the Jewish tribe of Banū Qurayẓah within Madinah broke their treaty and opened secret negotiations with the besieging coalition. After the coalition retreated, the dispute was referred to a third-party arbitrator (Saʿd ibn Muʿādh, RA), who applied the punishment specified in the Banū Qurayẓah's own Torah for treaty-breaking. The episode is carefully discussed in classical Islamic sources and should not be generalised to any contemporary Muslim-Jewish relationship.

It demonstrated that Muslim military strategy was open to non-Arab innovation when it served the community. The Prophet ﷺ accepted a Persian engineering technique without prejudice against its non-Arab origin. The principle: a foreign idea can save the community.

A foreign idea can save the community. Engineering and strategy are part of Islamic responsibility. Internal threats and external threats often arrive together. Allah's help comes at the moment of maximum effort — the storm came on day 27, after 27 days of full Muslim effort.

Read Surah Al-Aḥzāb (33) — substantial portions of which were revealed in the context of the trench. Sit one-to-one with a qualified Al-Azhar-graduate teacher to walk through the relevant tafsir and sirah. Book a free trial at eaalim.com/free-trial.