The Battle of the Trench — When the Muslims Dug Their Way to Victory
Introduction
In Shawwal of the fifth year after the Hijra (627 CE), tribes that usually fought one another united around a single aim: to destroy Medina. The battle is known by several names. "The Trench" refers to the ditch dug around the city, and "the Confederates" refers to the coalition the Quran so names, in verses of Surah al-Ahzab that describe those days vividly. It was not decided by the sword. The balance of power turned through an idea new to the Arabs, a long patience, and a wind God sent against the besiegers. It is among the deepest in impact of the Prophet's ﷺ campaigns, for it moved the Muslims from defending their very survival to holding the initiative.
Before the Battle — An Alliance Takes Shape
The battle did not come from nowhere. Four years had passed since the Hijra, marked by Badr and Uhud and ending with the expulsion of the Banu al-Nadir from Medina. Leaders of the Banu al-Nadir went to Mecca and urged Quraysh to fight the Muslims, then went to the tribes of Ghatafan and other tribes of Najd and united them behind the same goal.
The coalition consisted of Quraysh under Abu Sufyan, Ghatafan under Uyayna ibn Hisn al-Fazari, the Banu Sulaym, the Banu Asad, and others. The sources put it at about ten thousand fighters, against roughly three thousand in Medina. Arabia had never before seen a gathering this large for a single war.
Consultation — The Decision to Stay Inside the City
The news reached the Prophet ﷺ, and he gathered his companions to consult. The experience of Uhud was fresh in their minds, when the Muslims marched out to meet the enemy outside the city and what happened happened. This time the decision was to stay inside Medina and defend it.
Medina's geography supported that choice. On its southern, eastern, and western sides it was protected by rocky lava fields and tightly packed palm groves that cavalry could not cross. The northern side was exposed, and from there the danger would come.
Salman the Persian — An Idea the Peninsula Had Not Known
Salman al-Farisi, may God be pleased with him, advised digging a trench to close the exposed side. Salman had come from Persia, where this defensive measure was known; the Arabs were unfamiliar with it. The Prophet ﷺ and the Muslims accepted the proposal. So the decisive idea came from a man who was a stranger to the tribes of Arabia, who had crossed many lands in search of the truth, and whose name remains tied to this battle today.
The biographies say the digging took about six days. The work was divided among the Muslims, and the Prophet ﷺ took part himself. Al-Bukhari reports that he carried earth with his companions until dust covered his noble chest.
As We Dig — Scenes From the Work
Al-Bukhari reports that the companions dug while chanting verses to the effect that they were the ones who had pledged allegiance to Muhammad for jihad for as long as they lived, and the Prophet ﷺ would reply in the sense that there is no good but the good of the Hereafter, so forgive the Helpers and the Emigrants. He also reports that the Prophet ﷺ carried earth while repeating with them verses meaning that without God they would not have been guided, nor given charity, nor prayed, so send down tranquility upon us and make our feet firm.
Hunger was severe. Jabir ibn Abdullah, may God be pleased with him, related that the companions tied stones to their bellies from hunger, and that the Prophet ﷺ tied a stone to his belly. Jabir went to his wife, having seen intense hunger on the Prophet ﷺ. They had a little barley and a small kid, and she prepared the food. Jabir then went to invite the Prophet ﷺ quietly, but the Prophet ﷺ called all the people of the trench. They all ate, and the food remained as it was, one of the signs reported by al-Bukhari.
Jabir also related that a hard rock blocked the digging and the Muslims could not break it. The Prophet ﷺ took the pickaxe and struck it, and it turned to a heap of sand. The work was so grueling that the trench, simple as it was, ranks among the hardest things they faced.
The Besieged — When the Enemy Sees the Unfamiliar
The confederates arrived to find a trench blocking the road. Arab horses had never faced such an obstacle, so they halted in bewilderment and laid siege to the city. Archers exchanged fire across it, and groups of cavalry tried to cross at its narrowest points.
The biographies relate that Amr ibn Abd Wudd, a well-known knight of Quraysh, crossed the trench with a few men and demanded single combat. Ali ibn Abi Talib, may God be pleased with him, came out to him and killed him, and those with him fled.
During the siege the Muslims were kept from the afternoon prayer, and the Prophet ﷺ prayed it after sunset, as in Sahih al-Bukhari. It is also reported that he said that day: "May God fill their houses and graves with fire, as they kept us from the middle prayer."
The Ordeal — When Hearts Reached the Throats
The days of the siege were harsh, and the Quran captured that moment in a vivid phrase:
"When they came at you from above you and from below you, and when eyes shifted and hearts reached the throats, and you assumed about God various assumptions. There the believers were tested and shaken with a mighty shaking." (Quran 33:10–11)
Among the gravest dangers was that the Banu Qurayza, a Jewish tribe with a treaty with the Prophet ﷺ, broke the covenant after the leaders of the confederates pressed them. The Muslims now faced an enemy in front and a possible threat behind. At that moment the hypocrisy of those with sickness in their hearts surfaced, and they said what the Quran reports of them: "God and His Messenger promised us nothing but delusion." (Quran 33:12)
The Prophet ﷺ raised his hands in supplication, as reported in the two Sahihs: "O God, Revealer of the Book, swift in reckoning, defeat the confederates. O God, defeat them and shake them."
Hudhayfa in the Night — A Mission in the Heart of the Storm
Muslim reports in his Sahih that the Prophet ﷺ sent Hudhayfa ibn al-Yaman, may God be pleased with him, on a night of bitter cold and wind to bring news of the enemy. The night was dark and the wind was tearing up tents, and Hudhayfa was shivering from cold and hunger. The Prophet ﷺ told him to do nothing until he came back.
Hudhayfa entered the camp of the confederates and saw Abu Sufyan say something that made each man check who sat beside him. Hudhayfa moved first and asked the man next to him his name, so that his own identity stayed hidden. Then he heard Abu Sufyan order the withdrawal. Hudhayfa had been about to kill him, but remembered the Prophet's instruction and held back. He returned and told the Prophet ﷺ that the confederates were leaving.
Cunning and Wind — How the Siege Broke
The biographies relate that Nu'aym ibn Mas'ud, who had accepted Islam without his people knowing, came to the Prophet ﷺ, who permitted him to sow discord among the confederates. Nu'aym went about planting doubt between Quraysh, Ghatafan, and the Banu Qurayza, until each party feared the others would abandon it and their coordination collapsed at the hardest moment.
Then God sent upon the confederates a violent wind and forces they could not see, as the Quran states:
"O you who believe, remember God's favor upon you when armies came to you, and We sent against them a wind and armies you did not see. And God is ever Seeing of what you do." (Quran 33:9)
The wind put out their fires and overturned their pots and tents, and they left Medina on a cold, dark night. The Quran portrays that ending: "And God repelled those who disbelieved in their rage; they gained no good. And God spared the believers from fighting." (Quran 33:25)
After the Battle — A Victory Without Drawn Swords
After the confederates withdrew, the Prophet ﷺ spoke words that became the signature of this battle, reported by al-Bukhari:
"Now we will march against them, and they will not march against us."
And so it was. After the Trench, Quraysh never again sent a large army against Medina, and the Muslims moved from defending their existence to taking the initiative. The Quran describes the sincere believers' stance in those days:
"And when the believers saw the confederates, they said: This is what God and His Messenger promised us, and God and His Messenger spoke the truth. And it only increased them in faith and submission." (Quran 33:22)
The Lessons
Consultation and learning from others: The decisive idea came from Salman al-Farisi, who came from another civilization, and that did not stop the Prophet ﷺ and the companions from adopting it. Wisdom is the believer's lost property wherever he finds it.
Taking the means along with trust in God: The Muslims dug the trench with their own hands and prepared what they could, and then help came. There is no contradiction between action and supplication.
Leadership in hardship: The Prophet ﷺ shared the digging and the hunger with his companions, tying a stone to his belly as they tied theirs, so there was no distance between him and them in difficulty.
Learning from mistakes: The experience of Uhud was present in the decision to stay inside the city. Nations mature when they learn from their defeats.
Steadfastness when the crisis peaks: The faith that grew in the hour of fear is what separated those who stood firm from those who wavered, and the Quran immortalized this in the verses of al-Ahzab.
Conclusion
The Battle of the Trench was not the bloodiest of battles, but it is among the deepest in impact. Ten thousand besieged a small city, and a trench, an idea, and patience saved it, then a wind and a supplication. When the confederates left, the balance of power in Arabia had changed. The story remains a lesson that nations survive not by force alone, but by sound thinking, collective work, and steadfastness, and by trust that victory comes to those who take the means and endure.
"Now we will march against them, and they will not march against us."
— The Prophet Muhammad ﷺ, reported by al-Bukhari
Jil Al-Maerifa Blog | History & Civilizations Series




Comments