The Seerah · Chapter 22
Chapters Home
PART 4 · THE MADINAN PERIOD · الْعَهْدُ الْمَدَنِيُّ

STAGE 2 · DEFENDING THE MESSAGE

غَزْوَةُ الْأَحْزَابِ (الْخَنْدَقِ)

Chapter 22: The Battle of the Trench

Ten thousand at the gates of Madinah — a trench, a long siege, and the wind from Allah

Sheikh Mohamed Fawzyالشيخ محمد فوزي

© 2026 Sheikh Mohamed Fawzy. All rights reserved. Version 1.7

Shawwāl, 5 AH شَوَّالٌ، السَّنَةُ الْخَامِسَةُ

The Confederates — al-Aḥzāb

Quraysh and many Arab tribes joined together — the Confederates (al-Aḥzāb) — and marched on Madinah with about 10,000 men. The Muslims were about 3,000. Madinah was protected by lava fields and gardens on most sides; on the open north side, the Muslims dug a trench.

ḤARRAH · LAVA ḤARRAH · LAVA palm gardens and houses Madinah Mount Sal‘ · Muslim camp THE TRENCH · الخندق The Confederates · about 10,000 simplified sketch, not to scale
Ar-Raḥīq al-Makhtūm: Shawwāl, 5 AH (early 627 CE); the Confederates were about 10,000 and the Muslims about 3,000. Mūsā ibn ‘Uqbah dates it to Shawwāl 4 AH (quoted by al-Bukhari in the chapter heading of the Trench).

The famous report that Salmān al-Fārisī suggested the trench is not established: Ibn Hishām mentions it without a chain, and it comes from Abū Ma‘shar, who is weak, without a chain to the Companions (see al-‘Awshan, Mā shā‘a wa-lam yathbut fī al-sīrah). So it is not taught on the slides.

Hard work حَفْرُ الْخَنْدَقِ

Digging together on a cold morning

عَنْ أَنَسٍ رَضِيَ اللَّهُ عَنْهُ قَالَ: خَرَجَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ إِلَى الْخَنْدَقِ، فَإِذَا الْمُهَاجِرُونَ وَالْأَنْصَارُ يَحْفِرُونَ فِي غَدَاةٍ بَارِدَةٍ، فَلَمْ يَكُنْ لَهُمْ عَبِيدٌ يَعْمَلُونَ ذَلِكَ لَهُمْ، فَلَمَّا رَأَى مَا بِهِمْ مِنَ النَّصَبِ وَالْجُوعِ قَالَ «اللَّهُمَّ إِنَّ الْعَيْشَ عَيْشُ الْآخِرَهْ فَاغْفِرْ لِلْأَنْصَارِ وَالْمُهَاجِرَهْ» فَقَالُوا مُجِيبِينَ لَهُ نَحْنُ الَّذِينَ بَايَعُوا مُحَمَّدَا عَلَى الْجِهَادِ مَا بَقِينَا أَبَدَا.
Anas said: “The Messenger of Allah ﷺ went out to the trench, and there were the Muhājirūn and the Anṣār digging on a cold morning — they had no slaves to do the work for them. When he saw how tired and hungry they were, he said: ‘O Allah, the [true] life is the life of the Hereafter, so forgive the Anṣār and the Muhājirūn.’ They answered him: ‘We are those who pledged to Muḥammad to strive [in Allah’s cause] as long as we live, forever.’”
Sahih al-Bukhari 4099Sahih
A leader who works الْقَائِدُ يَعْمَلُ

“Were it not for Allah, we would not have been guided”

عَنِ الْبَرَاءِ رَضِيَ اللَّهُ عَنْهُ قَالَ: كَانَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يَنْقُلُ التُّرَابَ يَوْمَ الْخَنْدَقِ حَتَّى أَغْمَرَ بَطْنَهُ أَوِ اغْبَرَّ بَطْنُهُ يَقُولُ «وَاللَّهِ لَوْلَا اللَّهُ مَا اهْتَدَيْنَا وَلَا تَصَدَّقْنَا وَلَا صَلَّيْنَا فَأَنْزِلَنْ سَكِينَةً عَلَيْنَا وَثَبِّتِ الْأَقْدَامَ إِنْ لَاقَيْنَا إِنَّ الْأُلَى قَدْ بَغَوْا عَلَيْنَا إِذَا أَرَادُوا فِتْنَةً أَبَيْنَا» وَرَفَعَ بِهَا صَوْتَهُ «أَبَيْنَا أَبَيْنَا».
al-Barā’ said: “The Prophet ﷺ was carrying earth on the day of the Trench until the dust covered his stomach [or: until his stomach was covered in dust], and he was saying: ‘By Allah, were it not for Allah, we would not have been guided, nor given charity, nor prayed. So send down calm upon us, and make our feet firm if we meet [the enemy]. Those [people] have wronged us; whenever they wanted to turn us from our faith, we refused.’ And he raised his voice with it: ‘We refused! We refused!’”
Sahih al-Bukhari 4104Sahih

The leader of the believers carried earth like everyone else, until the dust covered him.

Hunger and patience الْكُدْيَةُ

“I will go down”

عَنْ جَابِرٍ رَضِيَ اللَّهُ عَنْهُ قَالَ: إِنَّا يَوْمَ الْخَنْدَقِ نَحْفِرُ فَعَرَضَتْ كُدْيَةٌ شَدِيدَةٌ، فَجَاءُوا النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فَقَالُوا هَذِهِ كُدْيَةٌ عَرَضَتْ فِي الْخَنْدَقِ، فَقَالَ «أَنَا نَازِلٌ». ثُمَّ قَامَ وَبَطْنُهُ مَعْصُوبٌ بِحَجَرٍ، وَلَبِثْنَا ثَلَاثَةَ أَيَّامٍ لَا نَذُوقُ ذَوَاقًا، فَأَخَذَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ الْمِعْوَلَ فَضَرَبَ، فَعَادَ كَثِيبًا أَهْيَلَ أَوْ أَهْيَمَ ...
Jābir said: “On the day of the Trench we were digging, and a very hard rock appeared. They came to the Prophet ﷺ and said: ‘This is a hard rock that has appeared in the trench.’ He said: ‘I will go down [into the trench].’ Then he stood up — and his stomach was tied with a stone [because of hunger]; we had stayed three days without tasting anything. The Prophet ﷺ took the pickaxe and struck, and the rock became a heap of loose, crumbling sand.…”
Sahih al-Bukhari 4101Sahih
The rock and the good news: in another report, when the Prophet ﷺ struck a great rock in the trench, he said “Allāhu akbar” with each strike and gave the good news that Allah would open al-Shām, Persia and Yemen to the Muslims. Source: Musnad Aḥmad (18694), from al-Barā’ — Ibn Ḥajar graded its chain ḥasan (Fatḥ al-Bārī 7/458); al-Albānī graded a similar report in Sunan al-Nasā’ī (3176) ḥasan; al-Arna’ūṭ graded Aḥmad’s chain weak. Told here in summary.
The siege الْحِصَارُ

“When eyes shifted and hearts reached the throats”

The Confederates could not cross the trench, so they surrounded Madinah for about a month. It was cold, food was little, and fear was great. Allah describes it:

إِذۡ جَآءُوكُم مِّن فَوۡقِكُمۡ وَمِنۡ أَسۡفَلَ مِنكُمۡ وَإِذۡ زَاغَتِ ٱلۡأَبۡصَٰرُ وَبَلَغَتِ ٱلۡقُلُوبُ ٱلۡحَنَاجِرَ وَتَظُنُّونَ بِٱللَّهِ ٱلظُّنُونَا۠ ۝١٠ هُنَالِكَ ٱبۡتُلِيَ ٱلۡمُؤۡمِنُونَ وَزُلۡزِلُواْ زِلۡزَالٗا شَدِيدٗا ۝١١
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.
Surat al-Aḥzāb 33:10–11سورة الأحزاب: ١٠–١١
The test shows the truth مَوْقِفُ الْمُؤْمِنِينَ

“This is what Allah and His Messenger promised us”

وَلَمَّا رَءَا ٱلۡمُؤۡمِنُونَ ٱلۡأَحۡزَابَ قَالُواْ هَٰذَا مَا وَعَدَنَا ٱللَّهُ وَرَسُولُهُۥ وَصَدَقَ ٱللَّهُ وَرَسُولُهُۥۚ وَمَا زَادَهُمۡ إِلَّآ إِيمَٰنٗا وَتَسۡلِيمٗا ۝٢٢
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.
Surat al-Aḥzāb 33:22سورة الأحزاب: ٢٢

The hypocrites said…

Tap to open

“Allah and His Messenger did not promise us except delusion” (al-Aḥzāb 33:12) — and some asked permission to go home.

The believers said…

Tap to open

“This is what Allah and His Messenger promised us” — and it only increased them in faith and submission.

A cold night لَيْلَةُ الْأَحْزَابِ

“Get up, Ḥudhayfah”

قَالَ حُذَيْفَةُ: ... لَقَدْ رَأَيْتُنَا مَعَ رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ لَيْلَةَ الْأَحْزَابِ وَأَخَذَتْنَا رِيحٌ شَدِيدَةٌ وَقُرٌّ فَقَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ «أَلَا رَجُلٌ يَأْتِينِي بِخَبَرِ الْقَوْمِ جَعَلَهُ اللَّهُ مَعِي يَوْمَ الْقِيَامَةِ». فَسَكَتْنَا فَلَمْ يُجِبْهُ مِنَّا أَحَدٌ ثُمَّ قَالَ «أَلَا رَجُلٌ يَأْتِينَا بِخَبَرِ الْقَوْمِ جَعَلَهُ اللَّهُ مَعِي يَوْمَ الْقِيَامَةِ». فَسَكَتْنَا فَلَمْ يُجِبْهُ مِنَّا أَحَدٌ ثُمَّ قَالَ «أَلَا رَجُلٌ يَأْتِينَا بِخَبَرِ الْقَوْمِ جَعَلَهُ اللَّهُ مَعِي يَوْمَ الْقِيَامَةِ». فَسَكَتْنَا فَلَمْ يُجِبْهُ مِنَّا أَحَدٌ فَقَالَ «قُمْ يَا حُذَيْفَةُ فَأْتِنَا بِخَبَرِ الْقَوْمِ». فَلَمْ أَجِدْ بُدًّا إِذْ دَعَانِي بِاسْمِي أَنْ أَقُومَ قَالَ «اذْهَبْ فَأْتِنِي بِخَبَرِ الْقَوْمِ وَلَا تَذْعَرْهُمْ عَلَيَّ». فَلَمَّا وَلَّيْتُ مِنْ عِنْدِهِ جَعَلْتُ كَأَنَّمَا أَمْشِي فِي حَمَّامٍ حَتَّى أَتَيْتُهُمْ فَرَأَيْتُ أَبَا سُفْيَانَ يَصْلِي ظَهْرَهُ بِالنَّارِ فَوَضَعْتُ سَهْمًا فِي كَبِدِ الْقَوْسِ فَأَرَدْتُ أَنْ أَرْمِيَهُ فَذَكَرْتُ قَوْلَ رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ «وَلَا تَذْعَرْهُمْ عَلَيَّ». وَلَوْ رَمَيْتُهُ لَأَصَبْتُهُ فَرَجَعْتُ وَأَنَا أَمْشِي فِي مِثْلِ الْحَمَّامِ فَلَمَّا أَتَيْتُهُ فَأَخْبَرْتُهُ بِخَبَرِ الْقَوْمِ وَفَرَغْتُ قُرِرْتُ فَأَلْبَسَنِي رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ مِنْ فَضْلِ عَبَاءَةٍ كَانَتْ عَلَيْهِ يُصَلِّي فِيهَا فَلَمْ أَزَلْ نَائِمًا حَتَّى أَصْبَحْتُ فَلَمَّا أَصْبَحْتُ قَالَ «قُمْ يَا نَوْمَانُ».
Ḥudhayfah said: “…We were with the Messenger of Allah ﷺ on the night of the Confederates, and a strong wind and bitter cold took hold of us. The Messenger of Allah ﷺ said: ‘Is there a man who will bring me news of the enemy? Allah will place him with me on the Day of Resurrection.’ We were silent, and none of us answered him. Then he said: ‘Is there a man who will bring us news of the enemy? Allah will place him with me on the Day of Resurrection.’ We were silent, and none of us answered him. Then he said: ‘Is there a man who will bring us news of the enemy? Allah will place him with me on the Day of Resurrection.’ We were silent, and none of us answered him. Then he said: ‘Get up, Ḥudhayfah, and bring us news of the enemy.’ I had no choice but to get up, since he had called me by my name. He said: ‘Go and bring me news of the enemy, and do not stir them up against me.’ When I left him, I felt as if I were walking in a warm bath-house, until I reached them. I saw Abū Sufyān warming his back by the fire. I put an arrow in the middle of my bow and wanted to shoot him — then I remembered the words of the Messenger of Allah ﷺ: ‘Do not stir them up against me.’ Had I shot, I would have hit him. So I went back, walking as if in a warm bath-house. When I came to him, told him the news of the enemy and had finished, I felt the cold. The Messenger of Allah ﷺ covered me with part of a cloak he had on, in which he was praying, and I kept sleeping until morning. When morning came, he said: ‘Get up, sleepy one!’”
Sahih Muslim 1788Sahih
The wind الرِّيحُ وَالْجُنُودُ

“He defeated the Confederates alone”

يَـٰٓأَيُّهَا ٱلَّذِينَ ءَامَنُواْ ٱذۡكُرُواْ نِعۡمَةَ ٱللَّهِ عَلَيۡكُمۡ إِذۡ جَآءَتۡكُمۡ جُنُودٞ فَأَرۡسَلۡنَا عَلَيۡهِمۡ رِيحٗا وَجُنُودٗا لَّمۡ تَرَوۡهَاۚ وَكَانَ ٱللَّهُ بِمَا تَعۡمَلُونَ بَصِيرًا ۝٩
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.
Surat al-Aḥzāb 33:9سورة الأحزاب: ٩
عَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ أَنَّ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ كَانَ يَقُولُ «لَا إِلَهَ إِلَّا اللَّهُ وَحْدَهُ، أَعَزَّ جُنْدَهُ، وَنَصَرَ عَبْدَهُ وَغَلَبَ الْأَحْزَابَ وَحْدَهُ، فَلَا شَيْءَ بَعْدَهُ».
Abū Hurayrah reported that the Messenger of Allah ﷺ used to say: ‘None has the right to be worshipped except Allah alone. He gave honour to His army, helped His servant, and defeated the Confederates alone — and there is nothing after Him.’
Sahih al-Bukhari 4114Sahih

The famous story of Nu‘aym ibn Mas‘ūd turning the Confederates against each other comes from the books of maghāzī without a connected chain — Ibn Isḥāq gives it without a chain; it is listed among reports that are well known but not established (al-‘Awshan, Mā shā‘a wa-lam yathbut). It is not taught on the slides. The authentic saying of the Prophet ﷺ «الْحَرْبُ خُدْعَةٌ» — “War is deception” (al-Bukhari 3030) — can be taught instead.

A turning point نُقْطَةُ التَّحَوُّلِ

“Now we will go out against them”

قَالَ سُلَيْمَانُ بْنُ صُرَدٍ: سَمِعْتُ النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يَقُولُ حِينَ أَجْلَى الْأَحْزَابُ عَنْهُ «الْآنَ نَغْزُوهُمْ وَلَا يَغْزُونَنَا، نَحْنُ نَسِيرُ إِلَيْهِمْ».
Sulaymān ibn Ṣurad said: I heard the Prophet ﷺ say, when the Confederates withdrew: ‘Now we will go out against them, and they will not come out against us. We will march to them.’
Sahih al-Bukhari 4110Sahih

Before the Trench, the Muslims defended Madinah. After it, the balance changed: Quraysh would never attack Madinah again.

After the Trench بَنُو قُرَيْظَةَ

Two understandings — and no blame

عَنِ ابْنِ عُمَرَ رَضِيَ اللَّهُ عَنْهُمَا قَالَ: قَالَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يَوْمَ الْأَحْزَابِ «لَا يُصَلِّيَنَّ أَحَدٌ الْعَصْرَ إِلَّا فِي بَنِي قُرَيْظَةَ». فَأَدْرَكَ بَعْضُهُمُ الْعَصْرَ فِي الطَّرِيقِ، فَقَالَ بَعْضُهُمْ لَا نُصَلِّي حَتَّى نَأْتِيَهَا. وَقَالَ بَعْضُهُمْ بَلْ نُصَلِّي، لَمْ يُرِدْ مِنَّا ذَلِكَ، فَذُكِرَ ذَلِكَ لِلنَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فَلَمْ يُعَنِّفْ وَاحِدًا مِنْهُمْ.
Ibn ‘Umar said: On the day of the Confederates, the Prophet ﷺ said: ‘No one should pray ‘Aṣr except at [the place of] Banū Qurayẓah.’ The time of ‘Aṣr came while some of them were still on the way. Some said: ‘We will not pray until we reach them.’ Others said: ‘No, we will pray — he did not mean that [we should miss the prayer].’ That was mentioned to the Prophet ﷺ, and he did not blame either of them.
Sahih al-Bukhari 4119Sahih

Why Banū Qurayẓah?

Banū Qurayẓah, a Jewish tribe of Madinah, had a treaty with the Muslims, but during the siege they broke it and sided with the Confederates (al-Bukhari 4028; Muslim 1766: “Qurayẓah made war”). After the Confederates left, the Muslims besieged them. They agreed to accept the judgment of Sa‘d ibn Mu‘ādh, their former ally, who gave a severe judgment for their treason in wartime, and the Prophet ﷺ approved it (al-Bukhari 4121; Ar-Raḥīq al-Makhtūm).

For older grades: the judgment itself, and the Prophet’s ﷺ words to Sa‘d «قَضَيْتَ بِحُكْمِ اللَّهِ», are in al-Bukhari 4121; it should be explained in its wartime context — a treaty broken from inside the city while it was besieged. In Muslim’s narration (1770) the order names Ẓuhr instead of ‘Aṣr; Ibn Ḥajar discusses how the two narrations fit together (Fatḥ al-Bārī).

Lessons دُرُوسٌ وَعِبَرٌ

What we learn

1

Work together

The Muhājirūn, the Anṣār and the Prophet ﷺ himself dug side by side, through cold and hunger.

2

Tests reveal hearts

In fear, the hypocrites doubted — and the believers grew in faith.

3

Victory is from Allah

“He defeated the Confederates alone” — with a wind and soldiers they could not see.

Review مُرَاجَعَةٌ

Quick quiz

Score: 0 / 4
1.Why did the Muslims dig a trench?
Correct.
To protect the open northern side of Madinah.
2.What did the Prophet ﷺ do while the trench was dug?
Right (al-Bukhari 4104).
He carried earth until the dust covered him.
3.What did Ḥudhayfah remember when he could have shot Abū Sufyān?
Yes (Muslim 1788).
He remembered the order and obeyed it.
4.How were the Confederates defeated?
Correct (al-Aḥzāb 33:9).
Allah sent a wind and soldiers they could not see.

Allah defeated the Confederates alone

ṣallā Allāhu ‘alayhi wa sallam ﷺ

NEXT · Chapter 23: The Treaty of Ḥudaybiyah · صُلْحُ الْحُدَيْبِيَةِ

All chapters →