At a glance
Stage 6When about ten thousand allies marched on Madinah, the Muslims dug a trench across its one open side, held out through a long siege, and the army went home.
- When
- Shawwal, 5 AH (early 627 CE). Some accounts place it in 4 AH.
- Where
- The open northern side of Madinah
- Known as
- Al-Khandaq, the Trench, and Al-Ahzab, the Confederates
- Key people
- The Prophet ﷺ, Salman al-Farisi, Jabir ibn Abdullah, Ali ibn Abi Talib, Nu'aym ibn Mas'ud, Sa'd ibn Mu'adh, Hudhayfah ibn al-Yaman; on the other side Abu Sufyan, Amr ibn Abd Wudd and the tribes allied with Makkah
- Key places
- Madinah, the trench, the lava fields and palm groves around the city
- Read time
- 8 minutes
Part oneA trench across the open side
In 5 AH, news came that the enemies of Madinah had joined hands. Leaders of the Banu Nadir, who had left the city after Uhud, travelled to Makkah and to the tribe of Ghatafan to ask for help. The Quraysh, Ghatafan and others agreed to attack together. The Quran calls them al-Ahzab, the confederates. Their army numbered about ten thousand. The Muslims had about three thousand fighting men. Riders from the tribe of Khuza'ah, who were friendly to the Muslims, brought the warning to Madinah as the army set out, which gave the city only days to prepare.
The Prophet ﷺ consulted his Companions once more. Salman al-Farisi (may Allah be pleased with him), a freed man who had come from Persia after a long search for the truth, suggested digging a trench. This was a way of defence known in his homeland and unfamiliar in Arabia. It was the first major campaign he joined as a free man. The Prophet ﷺ liked the idea, and it suited Madinah's geography. On most sides the city was shielded by dense palm groves, rocky lava fields and clustered houses that horsemen could not cross easily. Only the north was open.
The digging began at once, through hard, stony ground, with the Prophet ﷺ working beside the others. He carried earth until his clothes were covered in dust, and as they dug, the Companions chanted verses about their pledge to him. The work was divided among groups of men, each marking out a stretch. They dug in hunger, and some tied stones to their bellies against it. When the diggers met a rock too hard to break, the Prophet ﷺ was called, and it broke apart under his blows. It is reported that with each of three strikes he said "Allahu akbar" and gave glad tidings: the lands of Ash-Sham, Persia and Yemen would one day open to the Muslims. The hypocrites mocked this, since the Muslims were then digging a ditch to save their own city, but within a generation all three had come under Muslim rule. Jabir ibn Abdullah (may Allah be pleased with him) saw how hungry the Prophet ﷺ looked, prepared a little barley and a small kid, and invited him to eat. The Prophet ﷺ called all the diggers to come, and the food stretched to feed them. Jabir later said that about a thousand people ate until they were full, and the pot was still bubbling and the dough was still being baked. Families and children were moved into the forts of the city, and the army made camp with its back to the hills of Sal'. The trench was finished before the confederates arrived.
From the hadith
Narrated Jabir:
We were digging (the trench) on the day of (Al-Khandaq ( i.e. Trench )) and we came across a big solid rock. We went to the Prophet (ﷺ) and said, "Here is a rock appearing across the trench." He said, "I am coming down." Then he got up, and a stone was tied to his belly for we had not eaten anything for three days. So the Prophet (ﷺ) took the spade and struck the big solid rock and it became like sand. I said, "O Allah's Messenger (ﷺ)! Allow me to go home." (When the Prophet (ﷺ) allowed me) I said to my wife, "I saw the Prophet (ﷺ) in a state that I cannot treat lightly. Have you got something (for him to eat?" She replied, "I have barley and a she goat." So I slaughtered the she-kid and she ground the barley; then we put the meat in the earthenware cooking pot. Then I came to the Prophet (ﷺ) when the dough had become soft and fermented and (the meat in) the pot over the stone trivet had nearly been well-cooked, and said, "I have got a little food prepared, so get up O Allah's Messenger (ﷺ), you and one or two men along with you (for the food)." The Prophet (ﷺ) asked, "How much is that food?" I told him about it. He said, "It is abundant and good. Tell your wife not to remove the earthenware pot from the fire and not to take out any bread from the oven till I reach there." Then he said (to all his companions), "Get up." So the Muhajirn (i.e. Emigrants) and the Ansar got up. When I came to my wife, I said, "Allah's Mercy be upon you! The Prophet came along with the Muhajirin and the Ansar and those who were present with them." She said, "Did the Prophet (ﷺ) ask you (how much food you had)?" I replied, "Yes." Then the Prophet (ﷺ) said, "Enter and do not throng." The Prophet (ﷺ) started cutting the bread (into pieces) and put the cooked meat over it. He covered the earthenware pot and the oven whenever he took something out of them. He would give the food to his companions and take the meat out of the pot. He went on cutting the bread and scooping the meat (for his companions) till they all ate their fill, and even then, some food remained. Then the Prophet (ﷺ) said (to my wife), "Eat and present to others as the people are struck with hunger."
Part twoWeeks of siege
When the confederate army arrived, it found a wide ditch where it expected open ground. Its horsemen could not cross. Arab warfare was about quick charges and single combat, and the trench made both impossible. The army camped on the other side, and the siege began. Archers on both sides exchanged fire across the ditch. A few horsemen found a narrow place and crossed. Among them was Amr ibn Abd Wudd, one of the most feared fighters in Arabia, who called out for someone to face him. Ali ibn Abi Talib (may Allah be pleased with him) stepped forward, and Amr was killed in the duel that followed. The other horsemen turned back across the ditch.
Accounts of the length of the siege range from about two weeks to nearly a month. These were hard days for the Muslims. Food was short, the weather was cold, and the watch went on day and night, with groups taking turns along the trench. Throughout, the Prophet ﷺ asked Allah to defeat the confederates and shake their resolve. At the height of the fighting one afternoon, the arrows were so constant that the Prophet ﷺ and his Companions could not pray Asr at its time, and they made the prayer up after sunset. He asked Allah to fill the homes and graves of the attackers with fire for keeping them from the prayer, which shows how seriously he held it. Sa'd ibn Mu'adh (may Allah be pleased with him) was struck by an arrow and wounded. The Quran describes the fear, saying that eyes turned and hearts rose to throats, and that believers were shaken.
From the Quran
يَـٰٓأَيُّهَا ٱلَّذِينَ ءَامَنُوا۟ ٱذْكُرُوا۟ نِعْمَةَ ٱللَّهِ عَلَيْكُمْ إِذْ جَآءَتْكُمْ جُنُودٌ فَأَرْسَلْنَا عَلَيْهِمْ رِيحًا وَجُنُودًا لَّمْ تَرَوْهَا ۚ وَكَانَ ٱللَّهُ بِمَا تَعْمَلُونَ بَصِيرًا ٩ إِذْ جَآءُوكُم مِّن فَوْقِكُمْ وَمِنْ أَسْفَلَ مِنكُمْ وَإِذْ زَاغَتِ ٱلْأَبْصَـٰرُ وَبَلَغَتِ ٱلْقُلُوبُ ٱلْحَنَاجِرَ وَتَظُنُّونَ بِٱللَّهِ ٱلظُّنُونَا۠ ١٠ هُنَالِكَ ٱبْتُلِىَ ٱلْمُؤْمِنُونَ وَزُلْزِلُوا۟ زِلْزَالًا شَدِيدًا ١١
9O believers! Remember Allah’s favour upon you when ˹enemy˺ forces came to ˹besiege˺ you ˹in Medina˺, so We sent against them a ˹bitter˺ wind and forces you could not see. And Allah is All-Seeing of what you do. 10˹Remember˺ when they came at you from east and west, when your eyes grew wild ˹in horror˺ and your hearts jumped into your throats, and you entertained ˹conflicting˺ thoughts about Allah. 11Then and there the believers were put to the test, and were violently shaken.
The same surah describes how the true believers met that fear. When they saw the confederate army, they said this was what Allah and His Messenger had promised them, and it only increased their faith and their submission.
From the Quran
وَلَمَّا رَءَا ٱلْمُؤْمِنُونَ ٱلْأَحْزَابَ قَالُوا۟ هَـٰذَا مَا وَعَدَنَا ٱللَّهُ وَرَسُولُهُۥ وَصَدَقَ ٱللَّهُ وَرَسُولُهُۥ ۚ وَمَا زَادَهُمْ إِلَّآ إِيمَـٰنًا وَتَسْلِيمًا ٢٢
When the believers saw the enemy alliance, they said, “This is what Allah and His Messenger had promised us. The promise of Allah and His Messenger has come true.” And this only increased them in faith and submission.
The worst fear came from within. The Banu Qurayza, a Jewish tribe living on the southern side of Madinah, were party to the Charter. Huyayy ibn Akhtab, a leader of the exiled Banu Nadir, persuaded them to break their agreement and join the confederates. Now the Muslims worried about an attack from behind, with women and children in the forts. The Prophet ﷺ sent Sa'd ibn Mu'adh and Sa'd ibn Ubadah, the leaders of the Aws and the Khazraj, to find out the truth. If the news was good, they were to say so openly. If it was bad, they were to tell him in a hint that only he would understand, so that the people would not lose heart. They found the Qurayza hostile and insulting, and they came back with the agreed hint. The Prophet ﷺ answered with "Allahu akbar" and told the Muslims to rejoice, and he posted guards to protect the families. Then help came from an unexpected place. Nu'aym ibn Mas'ud of Ghatafan had become a Muslim in secret, and no one in the confederate camp knew it. The Prophet ﷺ told him to do what he could to divide the enemy. Nu'aym advised the Qurayza to ask the Quraysh and Ghatafan for hostages as a guarantee, and then warned the Quraysh and Ghatafan that any request for hostages was a trap. When the Qurayza asked, the allies refused, and each side now suspected the other. Neither would move first.
Part threeThe siege ends
After weeks of waiting, the confederates were losing patience. Supplies for ten thousand men and their animals ran low. A cold, strong wind in the night put out their fires and battered their tents. On one of those nights, dark and freezing, the Prophet ﷺ asked who would go and bring news of the enemy. No one answered, so he called on Hudhayfah ibn al-Yaman (may Allah be pleased with him) by name and told him not to provoke them in any way. Hudhayfah later said that the cold left him as he went. In the camp he saw Abu Sufyan warming himself by a fire and could have shot him, but he remembered the instruction and held back. He returned with word that they were preparing to leave. By morning the camps were empty. The Quran says that Allah sent winds and forces the believers could not see. For all the fear of those weeks, only a handful of men had been killed on either side.
After the withdrawal, the Prophet ﷺ is reported to have said that from now on the Quraysh would not attack Madinah, but the Muslims would go to them. No Makkan army marched on Madinah again.
The Prophet ﷺ had only just returned home and put down his armour when, the reports say, the angel Jibril came and told him that the angels had not yet put down theirs. Next, the Muslims turned to the Banu Qurayza, who had broken their pact in the middle of the siege. The Prophet ﷺ besieged their forts for about twenty-five days. They surrendered and accepted the judgement of Sa'd ibn Mu'adh, a leader of the Aws who had been their ally. He ruled according to their own scripture, the Torah, and the sentence of death for the men who had fought against the city was carried out. Accounts differ on the numbers. This is one of the hardest episodes in the seerah, and historians have long discussed it. Sa'd died of his wound not long afterwards.
Surah al-Ahzab, which takes its name from these events, also tells the believers that in the Messenger of Allah they have a good example. The failure cost the Quraysh standing among the tribes that had joined them. After the Trench, the Muslims were no longer fighting for survival.
Arab warfare was about quick charges and single combat, and the trench made both impossible.
WatchThe lecture for this chapter
The mapWhere it happened
- Madinah
- the trench on the northern side
- the hills of Sal'
- the camps of the confederates
- the lands of the Banu Qurayza
This map is a simple sketch to help you picture where events took place. Positions, distances and borders are approximate, so please use it for reference only, not as an accurate map.
SourcesSources for this chapter
The books, lectures and maps behind this page are listed on our Sources page.