5 AH – The Battle of the Trench: When Faith Stood Firm Against Ten Thousand
Introduction
The fifth year after the Hijrah was the hardest test Madinah had faced so far. In Shawwal 5 AH, the Quraysh, the tribe of Ghatafan and other allied tribes marched together against the small Muslim city. The Qur'an calls them al-Ahzab, "the Confederates", and a whole chapter, Surah Al-Ahzab, carries their name. Historians put their number at around ten thousand, against roughly three thousand Muslims. (Some early scholars, such as Musa ibn Uqba, dated the battle to 4 AH, but the commonly accepted date is Shawwal 5 AH.)
A Strategy Never Seen in Arabia
When news of the approaching army reached Madinah, the Prophet ﷺ consulted his Companions. Salman al-Farisi, who came from Persia, suggested digging a trench across the open northern side of the city. The Arabs had never used this tactic, and it changed the entire battle. (Sirah of Ibn Hisham)
The Prophet ﷺ worked together with his Companions. Al-Bara ibn Azib said he saw the Prophet ﷺ carrying earth out of the trench until dust covered his chest, and he heard him reciting the verses of Abdullah ibn Rawahah: "O Allah, without You we would not have been guided, nor given in charity, nor prayed." (Sahih al-Bukhari 4106)
The Muhajirun and Ansar sang as they carried the earth on their backs: "We are those who have pledged allegiance to Muhammad for Islam as long as we live." (Sahih al-Bukhari 4099) Sahl ibn Sa'd reports that the Prophet ﷺ said in reply:
اللَّهُمَّ لَا عَيْشَ إِلَّا عَيْشُ الْآخِرَةِ فَاغْفِرْ لِلْأَنْصَارِ وَالْمُهَاجِرَةِ
"O Allah, there is no life except the life of the Hereafter, so forgive the Ansar and the Emigrants." (Sahih al-Bukhari 4098)
Hunger and Patience
The work was done in hunger. Jabir ibn Abdullah reports that a huge rock blocked the trench, and when the Companions told the Prophet ﷺ about it, he went down to it with a stone tied to his stomach, because they had not eaten for three days. He struck the rock with a spade and it turned to sand. Jabir saw the Prophet's hunger, slaughtered a young goat and had his wife bake barley bread. The Prophet ﷺ called the diggers, and by Allah's will the small meal fed all of them while the pot was still full. (Sahih al-Bukhari 4101)
The Siege and the Fear
The Confederates arrived to find a trench in front of them, and the siege lasted for weeks (about a month in some reports). The Qur'an describes the condition of the believers:
إِذْ جَاءُوكُم مِّن فَوْقِكُمْ وَمِنْ أَسْفَلَ مِنكُمْ وَإِذْ زَاغَتِ الْأَبْصَارُ وَبَلَغَتِ الْقُلُوبُ الْحَنَاجِرَ وَتَظُنُّونَ بِاللَّهِ الظُّنُونَا هُنَالِكَ ابْتُلِيَ الْمُؤْمِنُونَ وَزُلْزِلُوا زِلْزَالًا شَدِيدًا
"When they came at you from above you and from below you, and when eyes turned away and hearts reached the throats, and you assumed about Allah various assumptions. There the believers were tested and shaken with a severe shaking." (Surah Al-Ahzab 33:10-11)
The pressure was so heavy that prayer times were disturbed. Jabir reports that Umar ibn al-Khattab came after sunset, cursing the disbelievers of Quraysh, and said he had not been able to pray Asr until the sun had set. The Prophet ﷺ replied that he had not prayed it either, then they performed ablution and prayed Asr after sunset, followed by Maghrib. (Sahih al-Bukhari 596 and 4112)
The Prophet's Dua
Abdullah ibn Abi Awfa reports that the Prophet ﷺ supplicated against the Confederates:
اللَّهُمَّ مُنْزِلَ الْكِتَابِ سَرِيعَ الْحِسَابِ اهْزِمِ الْأَحْزَابَ، اللَّهُمَّ اهْزِمْهُمْ وَزَلْزِلْهُمْ
"O Allah, Revealer of the Book, swift in taking account, defeat the Confederates. O Allah, defeat them and shake them." (Sahih al-Bukhari 4115; also 2933)
Two Different Reactions
The hypocrites spread doubt, as the Qur'an records:
وَإِذْ يَقُولُ الْمُنَافِقُونَ وَالَّذِينَ فِي قُلُوبِهِم مَّرَضٌ مَّا وَعَدَنَا اللَّهُ وَرَسُولُهُ إِلَّا غُرُورًا
"And when the hypocrites and those in whose hearts is disease said: 'Allah and His Messenger did not promise us except delusion.'" (Surah Al-Ahzab 33:12)
The true believers responded very differently:
وَلَمَّا رَأَى الْمُؤْمِنُونَ الْأَحْزَابَ قَالُوا هَٰذَا مَا وَعَدَنَا اللَّهُ وَرَسُولُهُ وَصَدَقَ اللَّهُ وَرَسُولُهُ ۚ وَمَا زَادَهُمْ إِلَّا إِيمَانًا وَتَسْلِيمًا
"And when the believers saw the Confederates, 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 submission." (Surah Al-Ahzab 33:22)
Divine Help: The Wind and the Unseen Forces
Then the situation changed. A violent wind and severe cold struck the enemy camp. Hudhayfah ibn al-Yaman reports that the Prophet ﷺ asked who would bring news of the enemy, and sent him with the instruction not to provoke them. Hudhayfah found the tents and fire in disorder, and heard Abu Sufyan tell the Quraysh to depart. (Sahih Muslim 1788) The Prophet ﷺ also said:
نُصِرْتُ بِالصَّبَا، وَأُهْلِكَتْ عَادٌ بِالدَّبُورِ
"I was made victorious by the east wind, and the people of Ad were destroyed by the west wind." (Sahih al-Bukhari 4105, from Ibn Abbas)
The Qur'an reminds the believers of this favour:
يَا أَيُّهَا الَّذِينَ آمَنُوا اذْكُرُوا نِعْمَةَ اللَّهِ عَلَيْكُمْ إِذْ جَاءَتْكُمْ جُنُودٌ فَأَرْسَلْنَا عَلَيْهِمْ رِيحًا وَجُنُودًا لَّمْ تَرَوْهَا ۚ وَكَانَ اللَّهُ بِمَا تَعْمَلُونَ بَصِيرًا
"O you who believe, remember Allah's favour upon you when armies came to you, and We sent upon them a wind and forces you did not see. And Allah is ever Seeing of what you do." (Surah Al-Ahzab 33:9)
وَرَدَّ اللَّهُ الَّذِينَ كَفَرُوا بِغَيْظِهِمْ لَمْ يَنَالُوا خَيْرًا ۚ وَكَفَى اللَّهُ الْمُؤْمِنِينَ الْقِتَالَ ۚ وَكَانَ اللَّهُ قَوِيًّا عَزِيزًا
"And Allah repelled those who disbelieved in their rage; they gained no good. And Allah sufficed the believers in battle, and Allah is ever Strong and Mighty." (Surah Al-Ahzab 33:25)
A Turning Point
When the Confederates withdrew, the Prophet ﷺ said: "Now we will fight them and they will not fight us; we will march against them." (Sahih al-Bukhari 4109 and 4110, from Sulayman ibn Surad) From this point the Quraysh no longer had the strength to launch a major campaign against Madinah.
Banu Qurayzah
The Jewish tribe of Banu Qurayzah had broken their treaty with the Muslims during the siege. After the Confederates left, the Prophet ﷺ besieged their fortresses. They agreed to accept the judgment of Sa'd ibn Mu'adh, their ally from the Aws tribe. Abu Sa'id al-Khudri reports that Sa'd gave his judgment, and the Prophet ﷺ said he had judged according to the judgment of Allah. (Sahih al-Bukhari 4121 and 3043; Sahih Muslim 1768)
The Verse of Hijab
Anas ibn Malik reports that when the Prophet ﷺ married Zaynab bint Jahsh and invited people to the wedding meal, Allah revealed the verse about not entering the Prophet's houses without permission (Surah Al-Ahzab 33:53). (Sahih al-Bukhari 4791; Sahih Muslim 1428) Scholars differ on the exact year of this marriage, and it is often placed in 5 AH.
Lessons from 5 AH
- Planning is part of tawakkul. The trench shows that trust in Allah goes together with taking practical measures and consultation.
- Leadership means sharing hardship. The Prophet ﷺ dug, carried earth and endured hunger like everyone else.
- Faith grows under pressure. The believers' faith increased when they saw the army, while the hypocrites' doubts increased.
- Help comes from Allah alone. The decisive blow came from a wind and unseen forces, not from the Muslims' own strength.
Conclusion
5 AH is remembered as the year the Muslims withstood the combined strength of Arabia without a large-scale battle. The Qur'an preserved this event so that every generation remembers that patience, unity and trust in Allah can overcome what looks impossible.
References
- Qur'an: Surah Al-Ahzab 33:9, 33:10-11, 33:12, 33:22, 33:25, 33:53
- Sahih al-Bukhari: 596, 2933, 3043, 4098, 4099, 4101, 4105, 4106, 4109, 4110, 4112, 4115, 4121, 4791 (sunnah.com numbering)
- Sahih Muslim: 1428, 1768, 1788
- Sirah: Ibn Hisham, Sirat Rasul Allah; Ibn Kathir, Al-Bidayah wa'n-Nihayah

