In short
- Date
- Shawwal 5 AH, early 627 CE (Musa ibn Uqbah gives Shawwal 4 AH)
- Place
- The open north side of Madinah
- Muslims
- About 3,000
- Confederates
- About 10,000: Quraysh, Ghatafan and their allies, gathered by leaders of Banu al-Nadir
- Length
- A siege of nearly a month
- Result
- The Confederates withdrew after a storm; no general battle
- Losses
- 6 Muslims martyred; 3 of the Confederates killed
In short: in 5 AH leaders of the Jewish tribe of Banu al-Nadir, who had been sent out of Madinah, persuaded Quraysh, Ghatafan and other tribes to attack Madinah together. About ten thousand men came. On the advice of Salman al-Farisi, the Muslims dug a trench across the open north side of the city, working in cold and hunger with the Prophet ﷺ carrying earth beside them. The Confederates could not cross it. During the siege Banu Qurayzah inside Madinah broke their treaty. After nearly a month Allah sent a cold wind and unseen armies, and the Confederates went home. The Prophet ﷺ said: "Now we will go out to them, and they will not come out against us".1
Why the battle happened
After Uhud, the Jewish tribe of Banu al-Nadir, who lived in Madinah under a treaty with the Prophet ﷺ, plotted against his life and were made to leave Madinah in 4 AH. Surah Al-Hashr was revealed about them.2 Some of their leaders, among them Huyayy ibn Akhtab, went to Makkah and to the tribe of Ghatafan and urged them to attack Madinah together and finish Islam. Quraysh, Ghatafan, Banu Sulaym, Banu Asad and others agreed. These allied forces are the Ahzab, the Confederates, and Surah Al-Ahzab is named after them.3
What happened
Digging the trench
The Prophet ﷺ consulted the Companions. Ibn Ishaq reports that Salman al-Farisi suggested a trench, as the Persians did, across the side of Madinah that was open to cavalry; the other sides were protected by lava fields, palm groves and houses.3 The Muhajirun and the Ansar dug in the cold mornings, carrying earth on their backs and chanting: "We are those who pledged to Muhammad to strive as long as we live." The Prophet ﷺ answered: "O Allah, there is no life but the life of the Hereafter, so forgive the Ansar and the Muhajirun".4 He carried earth until the dust covered his stomach.5 When the diggers met a rock they could not break, he struck it himself, though he had tied a stone to his stomach from hunger. Jabir then shared a small meal with him, and it fed the whole army of diggers.6
The siege
The Confederates arrived and found the trench in their way. They camped outside it for nearly a month. Allah describes the fear of those days:
إِذْ جَآءُوكُم مِّن فَوْقِكُمْ وَمِنْ أَسْفَلَ مِنكُمْ وَإِذْ زَاغَتِ ٱلْأَبْصَٰرُ وَبَلَغَتِ ٱلْقُلُوبُ ٱلْحَنَاجِرَ وَتَظُنُّونَ بِٱللَّهِ ٱلظُّنُونَا۠ ﴿١٠﴾ هُنَالِكَ ٱبْتُلِىَ ٱلْمُؤْمِنُونَ وَزُلْزِلُوا۟ زِلْزَالًۭا شَدِيدًۭا ﴿١١﴾
Iz jaaa'ookum min fawqikum wa min asfala minkum wa iz zaaghatil absaaru wa balaghatil quloobul hanaajira wa tazunnoona billaahiz zunoonaa Hunaalikab tuliyal mu'minoona wa zulziloo zilzaalan shadeedaa
(10) [Remember] when they came at you from above you and from below you, and when eyes shifted [in fear], and hearts reached the throats and you assumed about Allah [various] assumptions. (11) There the believers were tested and shaken with a severe shaking.
Quran 33:10-11 · Sahih International · Read Surah Al-Ahzab
During the siege, Banu Qurayzah, the last Jewish tribe in Madinah, broke their treaty and sided with the Confederates, which put the Muslim families inside the city at risk.3 A few horsemen of Quraysh forced a crossing at a narrow point, and Ali ibn Abi Talib killed their champion, Amr ibn Abd Wudd.3 Saad ibn Muadh was hit in the arm by an arrow.7 The fighting was so constant one day that the Muslims could not pray Asr until after sunset, and the Prophet ﷺ said: "They kept us from the middle prayer until the sun set. May Allah fill their houses and their graves with fire".8
How it ended
Nu'aym ibn Masud of Ghatafan accepted Islam in secret during the siege, and Ibn Ishaq reports that he sowed distrust between Quraysh, Ghatafan and Banu Qurayzah until their alliance came apart.3 Then Allah sent a bitterly cold wind that put out their fires and overturned their pots. On that night the Prophet ﷺ sent Hudhayfah ibn al-Yaman into the enemy camp, and he came back with news that they were leaving.9 By morning the Confederates were gone.
يَٰٓأَيُّهَا ٱلَّذِينَ ءَامَنُوا۟ ٱذْكُرُوا۟ نِعْمَةَ ٱللَّهِ عَلَيْكُمْ إِذْ جَآءَتْكُمْ جُنُودٌۭ فَأَرْسَلْنَا عَلَيْهِمْ رِيحًۭا وَجُنُودًۭا لَّمْ تَرَوْهَا ۚ وَكَانَ ٱللَّهُ بِمَا تَعْمَلُونَ بَصِيرًا ﴿٩﴾
Yaaa aiyuhal lazeena aamanuz kuroo ni'matal laahi 'alaikum iz jaaa'atkm junoodun fa arsalnaa 'alaihim reehanw wa junoodal lam tarawhaa; wa kaanal laahu bimaa ta'maloona Baseera
O you who have believed, remember the favor 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. And ever is Allah, of what you do, Seeing.
Quran 33:9 · Sahih International · Read Surah Al-Ahzab
الآنَ نَغْزُوهُمْ وَلاَ يَغْزُونَنَا، نَحْنُ نَسِيرُ إِلَيْهِمْ
When the Confederates had gone, the Prophet ﷺ said: "Now we will go out to them, and they will not come out against us. We will march to them."
Sahih al-Bukhari 4110 · narrated by Sulayman ibn Surad · sahih
Banu Qurayzah
The same day, Jibril came to the Prophet ﷺ and told him the angels had not yet laid down their arms, and pointed him to Banu Qurayzah.10 He told the Companions: "None of you should pray Asr except at Banu Qurayzah".11 After a siege of some weeks they surrendered and agreed to the judgement of Saad ibn Muadh, the chief of their old allies, the Aws. Saad ruled that their fighting men be put to death and the women and children taken captive, and the Prophet ﷺ said he had judged by the judgement of Allah.12 Saad died of his wound soon afterwards, and the Prophet ﷺ said the Throne of Allah shook at his death.13 Allah mentions Banu Qurayzah in 33:26-27.
The numbers, and where the sources differ
| What the sources say | Source | |
|---|---|---|
| Muslims | About 3,000 | Ibn Hisham |
| Confederates | About 10,000 (Quraysh about 4,000 of them) | Ibn Hisham; al-Raheeq al-Makhtum |
| Siege | Nearly a month; reports range from about two weeks to a month | Ibn Hisham; al-Raheeq al-Makhtum |
| Muslims martyred | 6, among them Saad ibn Muadh, who died later of his wound | Ibn Hisham |
| Confederates killed | 3, among them Amr ibn Abd Wudd | Ibn Hisham |
| Year | Shawwal 5 AH (Ibn Ishaq, followed by most); Shawwal 4 AH (Musa ibn Uqbah, quoted by al-Bukhari) | Ibn Hisham; Sahih al-Bukhari, chapter on al-Khandaq |
Verses revealed about the Trench
Surah Al-Ahzab 33:9-27 tells the story: the armies, the fear, the hypocrites who asked to go home, the believers who stood firm, and the end.
وَلَمَّا رَءَا ٱلْمُؤْمِنُونَ ٱلْأَحْزَابَ قَالُوا۟ هَٰذَا مَا وَعَدَنَا ٱللَّهُ وَرَسُولُهُۥ وَصَدَقَ ٱللَّهُ وَرَسُولُهُۥ ۚ وَمَا زَادَهُمْ إِلَّآ إِيمَٰنًۭا وَتَسْلِيمًۭا ﴿٢٢﴾
Wa lammaa ra al mu'minoonal Ahzaaba qaaloo haaza maa wa'adanal laahu wa Rasooluh; wa maa zaadahum illaaa eemaananw wa tasleemaa
And when the believers saw the companies, they said, "This is what Allah and His Messenger had promised us, and Allah and His Messenger spoke the truth." And it increased them only in faith and acceptance.
Quran 33:22 · Sahih International · Read Surah Al-Ahzab
وَرَدَّ ٱللَّهُ ٱلَّذِينَ كَفَرُوا۟ بِغَيْظِهِمْ لَمْ يَنَالُوا۟ خَيْرًۭا ۚ وَكَفَى ٱللَّهُ ٱلْمُؤْمِنِينَ ٱلْقِتَالَ ۚ وَكَانَ ٱللَّهُ قَوِيًّا عَزِيزًۭا ﴿٢٥﴾
Wa raddal laahul lazeena kafaroo bighaizihim lam yanaaloo khairaa; wa kafal laahul mu'mineenal qitaal; wa kaanal laahu Qawiyyan 'Azeezaa
And Allah repelled those who disbelieved, in their rage, not having obtained any good. And sufficient was Allah for the believers in battle, and ever is Allah Powerful and Exalted in Might.
Quran 33:25 · Sahih International · Read Surah Al-Ahzab
Lessons from the Trench
- Taking good means is part of trust in Allah. The trench was new to the Arabs; the Prophet ﷺ took good advice from wherever it came.
- A leader works beside his people: he dug, carried earth and went hungry with them.
- Hardship shows who is sincere. The hypocrites said, "Allah and His Messenger did not promise us except delusion" (33:12); the believers said, "This is what Allah and His Messenger had promised us" (33:22).
- Help can come in a form no one expects: a wind, and one man who changed sides in secret.
- The middle prayer is Asr, and missing it was a grief to the Prophet ﷺ. See how to pray.
Where it fits in the seerah
Battle of the Trench (Khandaq) took place in Shawwal 5 AH (Early 627 CE). For the whole life of the Prophet ﷺ in order, from his birth in Makkah to his passing in Madinah, see the Prophet Muhammad ﷺ life timeline. All the battles and turning points are listed on the seerah page.
Before this: Battle of Uhud · After this: Treaty of Hudaybiyyah
Questions
When was the Battle of the Trench?
In Shawwal 5 AH, early 627 CE, according to Ibn Ishaq and most historians. Musa ibn Uqbah gave Shawwal 4 AH, and al-Bukhari quotes his view.
Why is it called the Battle of the Trench?
Because the Muslims dug a trench (khandaq) across the open north side of Madinah to stop the cavalry of the Confederates. It is also called the Battle of al-Ahzab, the Confederates.
Whose idea was the trench?
Ibn Ishaq and other historians report that Salman al-Farisi suggested it, saying the Persians dug trenches when they feared cavalry.
How many fought at the Battle of the Trench?
About 3,000 Muslims against about 10,000 Confederates, according to Ibn Ishaq. There was no general battle; only a few horsemen crossed the trench.
Which surah is about the Battle of the Trench?
Surah Al-Ahzab, the Confederates. Verses 33:9-27 describe the siege, the wind, the hypocrites, the believers and Banu Qurayzah.
Sources
- Sahih al-Bukhari 4110, from Sulayman ibn Surad.
- Sahih al-Bukhari 4882: Ibn Abbas on Surah Al-Hashr.
- Ibn Hisham, al-Sirah al-Nabawiyyah, from Ibn Ishaq: the Battle of the Trench and Banu Qurayzah.
- Sahih al-Bukhari 4099 and 4100, from Anas.
- Sahih al-Bukhari 4104, from al-Bara.
- Sahih al-Bukhari 4101 and 4102, from Jabir.
- Sahih al-Bukhari 4122, from Aishah.
- Sahih al-Bukhari 2931; Sahih Muslim 627, from Ali.
- Sahih Muslim 1788, from Hudhayfah.
- Sahih al-Bukhari 4117, from Aishah.
- Sahih al-Bukhari 4119, from Ibn Umar.
- Sahih al-Bukhari 4121, from Abu Said al-Khudri.
- Sahih al-Bukhari 3803, from Jabir.
- Safi al-Rahman al-Mubarakpuri, al-Raheeq al-Makhtum.
- Quran: Arabic from the Tanzil Uthmani text, transliteration from Tanzil, English by Sahih International. Hadith Arabic is the standard wording of the collection named; gradings are given for every hadith outside al-Bukhari and Muslim.