All of the Seerah

The Seerah · Day 57 · The Trench and Hudaybiyyah

The Battle of the Trench, part 1

When all of Arabia marched on one city

Shawwal, 5 AH Madinah
Retold from Dr. Yasir Qadhi's Seerah seriesWatch the original

Khandaq means the trench. Ahzab means the gathered groups, the Confederates, and that one word tells you what is coming. For the first time in the history of Arabia, the tribes stop fighting each other and unite for a single purpose: to wipe Madinah off the map. Almost the whole peninsula gathers under one banner, and a small city of believers gathers under the other.

This is the showdown the last four years have been building toward. Over the next days we will walk through it with Dr. Yasir Qadhi: how the storm gathered, how a foreign idea saved the city, and how the Prophet ﷺ met an army of ten thousand not with a sword first, but with a shovel.

The expelled come back with an army

أَلَمْ تَرَ إِلَى الَّذِينَ أُوتُوا نَصِيبًا مِّنَ الْكِتَابِ يُؤْمِنُونَ بِالْجِبْتِ وَالطَّاغُوتِ وَيَقُولُونَ لِلَّذِينَ كَفَرُوا هَٰؤُلَاءِ أَهْدَىٰ مِنَ الَّذِينَ آمَنُوا سَبِيلًا

“Have you not seen those who were given a portion of the Scripture, who believe in jibt [superstition] and ṭāghūt [false objects of worship] and say about the disbelievers, "These are better guided than the believers as to the way"?”

Surah an-Nisa 4:51 Read 4:51 with tafsir

It began with a grudge. The tribe of Banu Nadir had been expelled from Madinah after they plotted to murder the Prophet ﷺ, dropping a boulder on him from their fortress wall. They were sent off with their lives and whatever their camels could carry, and they settled in Khaybar, barely two hours up the road. But they had left behind acres of date palms and plains of wealth, and land is worth far more than what fits on a camel. They wanted it back.

So their noblemen rode to Makkah, a high delegation, and made the Quraysh an offer: join us, attack Muhammad ﷺ together, and we will fund whatever you need. The Quraysh were wary of these people and quietly in awe of them, a tribe with a book and an ancient civilization, but the wound of Badr was still open and the trade route to Syria was destroyed. Then the Quraysh asked the question that exposed everything. Whose religion is closer to yours, they said, ours or his? And the delegation, to win an alliance, told a pagan idol-worshipping people: you are better guided than the believers.

Dr. Yasir Qadhi points out that Allah quoted that exact betrayal back to them, and we still recite it. They believed in jibt and taghut, superstition and false gods, yet bowed to it to bring down the truth. That is how far a grudge will take a person.

Ten thousand under two banners

ضُرِبَتْ عَلَيْهِمُ الذِّلَّةُ أَيْنَ مَا ثُقِفُوا إِلَّا بِحَبْلٍ مِّنَ اللَّهِ وَحَبْلٍ مِّنَ النَّاسِ وَبَاءُوا بِغَضَبٍ مِّنَ اللَّهِ وَضُرِبَتْ عَلَيْهِمُ الْمَسْكَنَةُ ۚ ذَٰلِكَ بِأَنَّهُمْ كَانُوا يَكْفُرُونَ بِآيَاتِ اللَّهِ وَيَقْتُلُونَ الْأَنبِيَاءَ بِغَيْرِ حَقٍّ ۚ ذَٰلِكَ بِمَا عَصَوا وَّكَانُوا يَعْتَدُونَ

“They have been put under humiliation [by Allāh] wherever they are overtaken, except for a rope [i.e., covenant] from Allāh and a rope [i.e., treaty] from the people [i.e., the Muslims]. And they have drawn upon themselves anger from Allāh and have been put under destitution. That is because they disbelieved in [i.e., rejected] the verses of Allāh and killed the prophets without right. That is because they disobeyed and [habitually] transgressed.”

Surah Aal Imran 3:112 Read 3:112 with tafsir

With the Quraysh on board, the delegation rode north to Ghatafan, the largest and wildest of the desert tribes. Ghatafan had no real stake in this fight, so the Banu Nadir bought them the only way they knew how: half the date harvest of Khaybar for a full year. A fortune, paid to hire mercenaries with no cause but coin. Then the smaller tribes were brought in too, each sending men, weapons, horses, whatever they had, all of them tied to that broken trade route.

Banu Nadir knew their own weakness. Their entire strength had always been the fortress, a wall to hide behind, and their walls were gone. The Sheikh draws out a pattern the Qur'an names of such people: humiliation follows them wherever they go, and they cannot stand on their own. They survive only by a rope from Allah or a rope from other men, by alliances borrowed and bought. Unable to fight alone, they assembled everyone else to fight for them.

When the armies converged, the books count around ten thousand. The whole of Madinah could field perhaps three thousand at most. And something was happening that Arabia had never seen: not two tribes against a third, but every tribe gathering under one of two banners, the banner of Islam and the banner of disbelief. In barely a decade, a man who began with a handful of followers had reordered the entire peninsula into a single showdown.

A foreign idea that saved the city

You cannot hide ten thousand men. The news reached the Prophet ﷺ, and he did what he always did: he gathered the companions in the masjid, laid the whole situation before them, and asked what they thought should be done. There was not much to say. When an army four times your size is marching on you, your only real question is where to make your stand.

Then Salman al-Farisi spoke, and this was the first battle he was free to fight in. Salman, who had crossed the world from Persia through monk after monk in search of the final prophet, who had been sold into slavery and bought his way out one date palm at a time, the Prophet ﷺ himself planting every seedling to free him. Salman said: in my homeland, when we feared a stronger enemy, we dug a trench. No Arab army had ever done this. It was a Persian tactic, entirely foreign.

And the Prophet ﷺ took it. Dr. Yasir Qadhi pauses here on something that runs through the whole tradition: in matters of worship and creed, we take nothing from anyone, we have what Allah gave us. But in the things of this world, in technology, knowledge, what simply works, the believer benefits from every people and does not care where it came from. Wisdom, the saying goes, is the lost property of the believer; he takes it wherever he finds it. The same Prophet ﷺ who sealed his letters in wax because that was how kings of the earth corresponded, now ordered a trench dug across the open face of Madinah, because the open face was the only way an army that size could come.

The poet who could not carry a sword

Before the digging, the Prophet ﷺ thought several steps ahead, as he always did. He sent the women and children to al-Fari, the strong fortress of Banu Haritha, because once every man was manning the trench, the city would be hollow, and one tribe still inside it, Banu Qurayzah, had loyalties no one could be sure of. To the fortress went the women, the children, the very old, and one young man: Hassan ibn Thabit.

Hassan was the poet of the Prophet ﷺ, and the companions tell us plainly, in the harsh word one of them used, that he was not a man of the battlefield; a sword in his hand made him tremble. So he was placed with the families. One night Safiyyah, the aunt of the Prophet ﷺ, heard a man climbing the wall, a scout sent by Banu Qurayzah, who had decided to flip, to test whether the fortress was guarded. She told Hassan to go down and deal with him. He could not. Do not shame me further, he said; this is not my field. So Safiyyah wrapped a man's cloak around herself, took a dagger in her teeth, climbed down into the dark, found the climber, and killed him, throwing his head down to his companion, who fled in terror believing the place was defended.

Dr. Yasir Qadhi tells this hard story on purpose, and refuses to sand it smooth, because of what comes next. This same Hassan, with this weakness on his record, was the one the Prophet ﷺ stood up and commanded: defend me with your tongue, and Jibril is with you. He had his own pulpit in the masjid for his poetry. When the Quraysh attacked the Prophet ﷺ in verse, the reply that struck them was Hassan's, and no one else's. Abu Bakr could not do it. Umar could not do it. The Sheikh's point lands like a hand on the shoulder: every one of us has a role no one else can fill, and our sins and shortcomings are no excuse to sit out the good we were made for. The believer never forgets his faults, and never lets them stop him from rising when his moment comes.

The Prophet ﷺ in the dust

هُوَ الَّذِي أَخْرَجَ الَّذِينَ كَفَرُوا مِنْ أَهْلِ الْكِتَابِ مِن دِيَارِهِمْ لِأَوَّلِ الْحَشْرِ ۚ مَا ظَنَنتُمْ أَن يَخْرُجُوا ۖ وَظَنُّوا أَنَّهُم مَّانِعَتُهُمْ حُصُونُهُم مِّنَ اللَّهِ فَأَتَاهُمُ اللَّهُ مِنْ حَيْثُ لَمْ يَحْتَسِبُوا ۖ وَقَذَفَ فِي قُلُوبِهِمُ الرُّعْبَ ۚ يُخْرِبُونَ بُيُوتَهُم بِأَيْدِيهِمْ وَأَيْدِي الْمُؤْمِنِينَ فَاعْتَبِرُوا يَا أُولِي الْأَبْصَارِ

“It is He who expelled the ones who disbelieved among the People of the Scripture from their homes at the first gathering. You did not think they would leave, and they thought that their fortresses would protect them from Allāh; but [the decree of] Allāh came upon them from where they had not expected, and He cast terror into their hearts [so] they destroyed their houses by their [own] hands and the hands of the believers. So take warning, O people of vision.”

Surah al-Hashr 59:2 Read 59:2 with tafsir

The trench ran for roughly two kilometers along the one exposed stretch of the city, the rest of Madinah shielded by black volcanic rock and dense date palms an army could not march through. Ten people were assigned to each portion. They had almost no slaves and barely a week, and they dug by hand, day and night, in the freezing cold of winter. And the men remembered, decades later, that the thing which kept them going was the sight of the Prophet ﷺ down in the trench with them.

He did not stand and supervise. Al-Bara ibn Azib said he saw the Prophet ﷺ carrying dirt until the dust of the trench covered his whole chest. He was hungry as they were hungry, cold as they were cold, and when he saw their exhaustion he made du'a for them: O Allah, there is no good except the good of the next life, so honor the Ansar and the Muhajirun. And they sang it back to him. The believers in those who hid behind walls is exactly the believers the Qur'an had drawn of the expelled: people who trusted their fortresses to save them from Allah, until Allah came at them from where they never expected. Here was the opposite, a Prophet ﷺ with no fortress, sweating in the dirt, and his strength was not in stone but in Allah.

And as they dug they chanted, all of them lifting the last word together in one voice: by Allah, were it not for You we would not be guided, nor give charity, nor pray, so send tranquility down upon us and make our feet firm if we meet the enemy, for they have transgressed against us, and if they want fitnah, we refuse. Ten thousand were coming. The believers answered with shovels and a song.

A wall of trust, and a siege ahead

Understand what the trench really was. It was not a fortress and it was never meant to be a permanent defense. It was a stalling tactic, an act of holy desperation. The city was already short of food before the army even arrived; barley was running out, meat was running out, and now they were sealing themselves in. They could not outlast a siege. All the trench could buy was time, and into that time they poured their trust in Allah, knowing that He does not fail His servants.

Dr. Yasir Qadhi leaves us here on purpose, with the trench dug and the dust still on the Prophet's ﷺ chest, the women in the fortress, ten thousand massing on the horizon, and one uncertain tribe waiting inside the walls. What happens next, the Sheikh promises, is a string of miracles: the great rock that would not break until the Prophet ﷺ struck it himself, the food that fed an army, the predictions he gave from the bottom of a ditch. And waiting behind it all is the betrayal of Banu Qurayzah, whose scout already lies dead at the foot of a fortress wall.

A dua from this day

Allahumma la khayra illa khayru al-akhirah, fa-aghfir lil-Ansari wal-Muhajirah

O Allah, there is no good except the good of the next life, so forgive the Ansar and the Muhajirun.

What this day teaches

The Trench opens with a city outnumbered four to one, and still it hands you a way to stand. These threads run straight out of the Sheikh's telling.

  • Take wisdom wherever you find it.

    The trench was a foreign idea, and the Prophet ﷺ took it without hesitation. In worship we keep what Allah gave us; in the work of this world, the believer benefits from every people and never asks where a good idea was born.

  • Your weakness is not your excuse.

    Hassan ibn Thabit could not lift a sword, yet he did what Abu Bakr and Umar could not. Whatever you cannot do, there is something only you can. Do not let a shortcoming, or a sin, keep you from the good you were made for.

  • Lead from the dust, not the distance.

    The Prophet ﷺ did not point at the trench, he dug in it, dirt to his chest, hungry with the hungry. That sight carried the companions further than any command. The most moving leadership is the kind that gets its hands dirty first.

  • Walls do not save you, Allah does.

    The expelled trusted their fortresses and Allah came at them from where they never expected. The believers had no fortress at all, only a ditch and their trust. Plan with everything you have, then lean on the only One who decides the outcome.

  • Do the work, then trust.

    They dug a trench they knew could not hold forever, and poured their trust into the time it bought. Effort and tawakkul are not rivals: you take every means available, and then you hand the result to Allah.

Why this day stays with you

Day fifty-seven sets the stage for the hardest test Madinah will face. Almost all of Arabia has gathered to end the believers in a single stroke, and the answer to that overwhelming force is a trench dug by hand, a Prophet ﷺ covered in dust, a poet guarding the women because it is the one place he can serve, and a city that has run out of options but not out of trust. The Qur'an will later describe this very moment, when they came upon the believers from above them and from below them, eyes shifting in fear and hearts in the throat. The trench is dug. The siege is about to close.

So let your du'a be the one they sang from the bottom of the ditch. O Allah, there is no good except the good of the next life, so honor the Ansar and the Muhajirun who dug it; send Your tranquility down upon us when the armies gather and our hearts climb to our throats, make our feet firm, and let us be of those who trust You with the outcome after we have done all we can. And send Your peace upon Your Messenger Muhammad ﷺ, who led us from the dust. Ameen.

Questions

Why is it called the Battle of the Trench, and also the Battle of the Ahzab?
Khandaq means the trench, after the ditch Salman al-Farisi proposed digging around the exposed side of Madinah. Ahzab means the gathered groups, the Confederates: the many tribes that united into one army for this campaign. Both names describe the same event, one by its defense and one by its attackers.
What year did the Battle of the Trench take place?
Dr. Yasir Qadhi notes a real difference of opinion. An explicit report in Bukhari from Abdullah ibn Umar, who was rejected at Uhud at fourteen and accepted at Khandaq at fifteen, points to the fourth year, and giants like Imam al-Bukhari held this. But the great specialists of seerah, piecing the whole story together, place it in Shawwal of the fifth year of the Hijra, and the Sheikh takes the fifth year as the stronger view.
Who proposed digging the trench, and why was that significant?
Salman al-Farisi, in his first battle as a free man, suggested it from his Persian homeland's tactics. It was an idea entirely foreign to the Arabs. The Prophet ﷺ adopting it shows that Islam welcomes beneficial knowledge and technology from any culture, even as it takes its worship and creed from revelation alone.
Why does the Sheikh tell the difficult story of Hassan ibn Thabit?
Because it shows the humanity of the companions and frees us to relate to them. Hassan was the Prophet's ﷺ poet but could not fight, and the books record it plainly. Dr. Yasir Qadhi tells it not to mock him, which would be a sin, but to teach a lesson: everyone has a unique role, and our weaknesses and even our sins must not stop us from stepping up for the good only we can do.
Was the trench meant to win the war?
No. It was a stalling tactic, not a permanent defense. Madinah was already low on food and could not outlast a long siege. The trench bought time, and the believers filled that time with trust in Allah, who delivered them from where they never expected.

Retold faithfully from Dr. Yasir Qadhi's Seerah of Prophet Muhammad ﷺ, episode 57: the Battle of Khandaq, part 1 (Memphis Islamic Center, 2013). Qur'an: Sahih International, verified via quran.ai. The narration is the Sheikh's, the phrasing is Buruja's.

Carry it today

Take wisdom wherever you find it.

The trench was a foreign idea, and the Prophet ﷺ took it without hesitation. In worship we keep what Allah gave us; in the work of this world, the believer benefits from every people and never asks where a good idea was born.

What stayed with you?

A private note, kept only on this device. Find it again on your journey page.

Watch the lecture

This retelling is drawn from Dr. Yasir Qadhi's Seerah series. Watch the original on YouTube:

Watch episode 57Full Seerah playlist on YouTube →

A day of his life ﷺ, retold, every day.

Subscribe, free