غَزْوَةُ الْخَنْدَق

The Battle of the Trench: How 3,000 Held Off 10,000

Shawwal 5 AH • 627 CE • Ghazwat al-Khandaq, the Battle of the Confederates

At a Glance

📅
Date

Shawwal 5 AH, March–April 627 CE

👥
Key Figures

The Prophet Muhammad, Salman al-Farsi (RA), Ali (RA); Abu Sufyan for the confederates

📍
Location

The northern approaches of Madinah, shielded by a great trench

✨
Significance

The last Quraysh attempt to destroy Islam; the siege collapsed without a pitched battle

A deep defensive trench cut across a desert plain before ancient city walls
The trench that stopped an army

Background: The Confederacy Forms

After Uhud, the Quraysh knew they had wounded Madinah but not destroyed it. The final push came from an unexpected quarter: the leaders of Banu Nadir, the Jewish tribe expelled from Madinah for plotting against the Prophet, traveled to Makkah and urged the Quraysh to finish the job. Led by Huyayy ibn Akhtab, they promised their full support, then went to the powerful Ghatafan tribe and other Bedouin clans with the same proposal, offering them half of Khaybar’s date harvest for their help.

The result was the largest army Arabia had ever assembled against the Muslims: the Quraysh of Makkah, the Ghatafan and their allies, and the exiled Banu Nadir, some ten thousand fighters with hundreds of horses and camels, marching on Madinah under the command of Abu Sufyan. Against them stood about three thousand Muslims. Open battle was out of the question.

What Happened

Salman’s Idea

When news of the confederacy reached Madinah, the Prophet consulted his companions, as was his way. It was Salman al-Farsi, the Persian companion who had traveled through Persia and seen its siege warfare, who proposed the unthinkable: dig a trench across the exposed northern approach to the city. Madinah’s other sides were protected by lava fields, rocky ground, and dense palm groves; only the north lay open, and a deep, wide ditch would make it impassable to cavalry. The Arabs had never used such a tactic, but the Prophet accepted the idea at once.

The Muslims went to work in the cold of winter, in hunger so severe that the companions tied stones to their stomachs. The Prophet himself dug alongside them, carrying earth until dust covered his chest. The trench stretched for several kilometers, and it was finished in about six days. When the diggers struck a massive rock they could not break, the Prophet took the pickaxe himself; with each strike, sparks flew, and he announced glad tidings of the future conquests of Yemen, Syria, and Persia.

The Siege

The confederates arrived to find their cavalry useless. They camped beyond the trench and settled into a siege that dragged on for nearly four weeks. At one narrow point, the famed Quraysh warrior Amr ibn Abd Wudd managed to spur his horse across the ditch with a few companions. Ali ibn Abi Talib went out to meet him, and after Amr refused the call to Islam, Ali defeated him in single combat. The rest did not dare cross.

Inside the city, the strain told. The hypocrites slipped away, and worse, Huyayy ibn Akhtab persuaded Banu Qurayzah, the Jewish tribe still inside Madinah and bound by treaty to the Muslims, to break their pact and join the confederates. The city faced enemies on two sides. It was then that the Prophet sent Nu’aym ibn Mas’ud, a recent secret convert from the Ghatafan, into the enemy camp with a mission of diplomacy: sow mistrust between the Quraysh and Banu Qurayzah. His whispers worked. Each side began to suspect the other, and their coordination fell apart.

The Wind That Ended It

Then Allah sent what no army could withstand. A violent, freezing wind tore through the confederate camp by night, overturning their tents, extinguishing their fires, and driving sand into everything. Their morale, already sinking from hunger, cold, and mutual suspicion, collapsed entirely. Abu Sufyan gave the order to withdraw, and by morning the vast confederacy was streaming home in disarray. The siege had ended without a pitched battle.

The Quran describes that night in Surah Al-Ahzab, “The Confederates,” revealed about this very battle:

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

Ya ayyuhalladhina amanu-dhkuru ni‘matallahi ‘alaykum idh ja’atkum junudun fa-arsalna ‘alayhim rihan wa junudal-lam tarawha; wa kanallahu bima ta‘maluna basira.

“O you who have believed, 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. And Allah is ever Seeing of what you do.” (33:9)

اے ایمان والو، اللہ کی اس نعمت کو یاد کرو جب تم پر لشکر چڑھ آئے تو ہم نے ان پر آندھی بھیجی اور ایسے لشکر جو تمہیں نظر نہ آئے۔ اور اللہ جو کچھ تم کرتے ہو اسے دیکھنے والا ہے۔

A violent desert sandstorm sweeping over an empty camp at night
The wind that scattered the confederates

Aftermath: The Turning of the Tide

The failed siege broke the Quraysh’s power for good. The Prophet said, as recorded in Sahih al-Bukhari, that from then on the Muslims would take the initiative against the Quraysh, and the Quraysh would not attack them again. He was right: the next great events were the Treaty of Hudaybiyyah and, two years later, the peaceful conquest of Makkah.

The betrayal of Banu Qurayzah was dealt with immediately after the siege. They were besieged in their fortress, surrendered, and accepted the judgment of Sa’d ibn Mu’adh, the chief of the Aws and their former ally, who judged them by the law of their own scripture. The Quran refers to this in the same surah (33:26–27). It was a stern judgment, but it removed the last internal threat to Madinah’s security.

Key Figures

  • Salman al-Farsi (RA): the Persian companion whose trench proposal saved the city; the Prophet said “Salman is of us, the household.”
  • Ali ibn Abi Talib (RA): defeated the champion Amr ibn Abd Wudd in single combat at the trench.
  • Nu’aym ibn Mas’ud (RA): the secret convert whose diplomacy broke the confederates’ trust in each other.
  • Abu Sufyan: commander of the ten-thousand-strong confederacy, forced into humiliating retreat.

Lessons and Legacy

The Battle of the Trench is a masterclass in leadership. The Prophet consulted his companions and accepted the best idea regardless of its source, even from a former Persian slave suggesting a foreign tactic. He worked in the ditch beside the youngest companion. He used diplomacy as skillfully as defense. And when the wind came, the believers recognized it as what the Quran called it: the favor of Allah upon patient, trusting hearts.

The trench also closed an era. The confederacy at Madinah’s walls was the last time the enemies of Islam could unite Arabia against it. From 627 CE onward, the initiative belonged to the Muslims, and the road led, through Hudaybiyyah, to the conquest of Makkah. This Islamic history series began with an army of elephants stopped by birds; it fittingly pauses with an army of ten thousand stopped by a ditch and a wind.

FAQ

When was the Battle of the Trench fought?

+

The battle, also called the Battle of the Confederates (Ghazwat al-Ahzab), took place in Shawwal 5 AH, in March and April 627 CE. The siege lasted nearly four weeks before the confederates withdrew.

Who suggested digging the trench?

+

Salman al-Farsi (RA), the Persian companion. Having seen Persian siege warfare, he proposed digging a trench across Madinah’s exposed northern approach, a tactic unknown to the Arabs. The Prophet accepted the idea immediately.

How did the siege end?

+

A violent windstorm tore through the confederate camp, destroying tents and fires, while hunger, cold, and mistrust sown by Nu’aym ibn Mas’ud broke their unity. Abu Sufyan ordered a retreat, and the ten-thousand-strong army withdrew without a pitched battle. The Quran mentions the wind in 33:9.

How many fought on each side?

+

The confederates numbered about ten thousand, from the Quraysh, Ghatafan, and other tribes with the exiled Banu Nadir. The Muslims could field only about three thousand defenders, which is why the trench strategy was chosen.

What happened to Banu Qurayzah after the battle?

+

Having broken their treaty with the Muslims during the siege, Banu Qurayzah were besieged in their fortress after the confederates left. They surrendered and accepted the judgment of Sa’d ibn Mu’adh, their former ally, who judged them according to their own scripture.

Final Thoughts

Three thousand against ten thousand, a ditch against cavalry, a wind against an empire of tribes. The Battle of the Trench is the seerah’s great reminder that Allah’s help comes to those who prepare with wisdom and trust with patience. Salman’s trench, Nu’aym’s diplomacy, and the wind of that terrible night all worked together, and the last united assault on Islam dissolved into the desert. From that spring of 627 CE, the Muslims never looked back.

Continue Reading

Return to the beginning with the Year of the Elephant, or explore the full Islamic history timeline to revisit all ten chapters of the early seerah.

Share this page