Battle of the Trench – Also know as, Battle of Khandaq & Ghazwah al-Ahzab

Soon after winning the Battle of Uhud, the Quraysh leaders realised that they had fought indecisively and that their victory had not borne any fruit for them. On the flip side, Islam had successfully reestablished its authority within a short span of time.

The loss at the Battle of Uhud had taught Muslims the significance of increasing military strength and possessing combat knowledge. All of the lessons, planning, and hard work were on display during the Battle of the Trench. Instead of focusing only on fighting, Muslims strategically planned to dig a trench around the northern boundary of Madinah to slow down the archers.

Fought in the month of Shawwal, the Battle of the Trench distinguished truth from falsehood and the believers from the non-believers, teaching the importance of believing in Allah SWT and trusting His plans during even the hardest of times.

Here is everything you need to know about the Battle of the Trench, otherwise known as the Battle of Confederates, Ghazwa al-Ahzab, and the Battle of Khandaq

What Was the Battle of the Trench?

The Battle of Trench was a 30-day long siege of Yathrib (now Madinah) fought between the Muslims and the confederates of the Quraysh and Jews. While the Muslim army comprised only 3,000 soldiers, the opponents were 10,000 strong.

Led by Prophet Muhammad (PBUH), the outnumbered Muslims decided to dig and fight from behind a trench. Paired with Madinah’s natural fortification, the trench rendered the opponent’s cavalry useless, locking them from all sides in a stalemate.

Even though the opponents tried to persuade another Jewish tribe, Banu Quraydhah to attack from the inside, they failed, and the well-organized defenders fought fearlessly until a storm caused the siege to end in a fiasco. 

Al-Bara bin Azib narrated, “I saw the Prophet Muhammad (PBUH) on the Day of (the battle of) al-Khandaq, carrying earth with us and saying, ‘By Allah SWT, without Allah SWT we would not have been guided, neither would we have fasted, nor would we have prayed.

Digging of the Trench

When the Messenger (PBUH) of Allah SWT heard the news that the Jews and Quraysh were lobbying against the Muslims, he called his companions to strategize. Prophet Muhammad (PBUH) started taking suggestions and that is when Salman al-Farsi (RA) advised him to dig a trench around the northern boundary of Madinah as the other sides are covered with mountains and dense forests.

Prophet Muhammad (PBUH) divided the Muslims into groups of ten and asked them to dig a trench. It is narrated that when the Companions (may  Allah  be  pleased  with  them) were digging al-Khandaq (the trench), they found a rock which was too immense for their spades to break. So, they sought the help of the Prophet  (PBUH). He struck the rock three times, and each time would strike it, a bright light would spark – it was like a light in the middle of a dark night. He  took the spade, and struck the rock uttering: “Allahu Akbar! ( Allah is The Greatest) The keys of ancient Syria are granted to me, I swear by Allah, I can see its palaces at the moment”; on the second strike he said: “Allahu Akbar, Persia is granted to me, I swear by Allaah, I can now see the white palace of Madain”; on the third strike he said: “Allahu Akbar, I have been given the keys of Yemen, I swear by Allah, I can see the gates of San’a while I am in my place.” (Musnad Ahmad).

Importance of the Battle of the Trench

The Muslims’ victory in the Battle of the Trench and the failure of the siege of the pagan Quraysh marked the beginning of Prophet Muhammad’s (PBUH) political ascendancy in Madinah. The non-believers had exerted their utmost strength to kill Prophet Muhammad (PBUH) and the Muslims.

As a consequence of the defeat, the Quraysh lost their prestige and their trade with Syria. The tale of the strong leadership and belief of Prophet Muhammad (PBUH) inspired the non-believers residing in Makkah to convert to Islam

It is reported that on the day of the Battle of Trench, The Muhajirun and the Ansar started digging the trench around Medina carrying the earth on their backs and saying, “We are those who have given a pledge of allegiance to Muhammad that we will carry on Jihad as long as we live.” The Prophet (PBUH) kept on replying, “O Allah, there is no good except the good of the Hereafter; so confer Your Blessings on the Ansar and the Muhajirun.” (Sahih Bukhari 2835)

Allah’s Messenger (PBUH) at one time when he confronted the enemy, and was waiting for the sun to set, stood up and said, “O people! Do not long for encountering the enemy and supplicate to Allah to grant you security. But when you face the enemy, show patience and steadfastness; and keep it in mind that Jannah lies under the shade of the swords.” Then he invoked Allah, saying, “O Allah, Revealer of the Book, Disperser of the clouds, Defeater of the Confederates, put our enemy to rout and help us in over-powering them.” (Bukhari and Muslim)

Why Was the Battle of the Trench Fought?

Initiated by the Quraysh, the battle took place because the pagans considered Islam as a threat to their political supremacy and economic security in Saudi Arabia. Abu Sufyan and the other Quraysh and Jewish leaders believed that the only way to safeguard their existence and restore their hegemony was to kill Prophet Muhammad (PBUH). And so, with the aim to exterminate all Muslims, the Quraysh decided to strike a final and crushing blow to the city of Madinah.

The reason why Muslims participated in the Battle of the Trench was to protect Madinah from being attacked by Banu al-Nadir, Banu al-Qurayza, Ghatafan and the Quraysh tribes

Ibn Khatir (RA) narrates that, “The reason why the confederates came was that a group of the leaders of Banu al-Nadir, whom the Messenger (PBUH) of Allah SWT had expelled from Al-Madinah to Khaybar, including Sallam bin Abu Al-Huqayq, Sallam bin Mishkam, and Kinanah bin Ar-Rabi, went to Makkah where they met with the leaders of Quraysh and incited them to make war against Prophet Muhammad (PBUH).”

When Was the Battle of the Trench Fought?

The Battle of Trench was a 30-day-long siege. It started on December 29, 626 AD, and ended on January 29, 627 AD. According to Islamic narrations, Ghazwah al Ahzab took place in the month of Shawwal, 5 AH. 

Where Did the Battle of the Trench Take Place?

when did the battle of trench take placeThe Battle of the Trench (Ghazwah al-Khandaq) occurred on the outskirts of Madinah, Saudi Arabia. Prophet Muhammad (PBUH) and his army played a defensive strategy and dug a deep trench to stop the Quraysh confederates from entering the city of Madinah.

Even though Banu Nadir succeeded in bribing the Jewish tribe of Banu Qurayza attack the Muslim army from the inside, it resulted in chaos. The Muslim army bravely took back control and conquered the area of Banu Qurayza. 

How Many Muslims Fought in the Battle of Trench?

An army of 3000 Muslims (Muhajirun and Ansar) bravely fought against 10,000 confederates, six hundred horses, and some camels in the Battle of Trench.

Outcome of the Battle of the Trench

Even after several trials by the Quraysh army, they failed to cross the trench. This not only made the confederates restless, but their battle animals also suffered major war wounds. With every passing day, the harsh winds of Medina grew stronger, making survival difficult for the opponents by creating a challenging scenario for the raiding army.

Although the Quraysh fought hard to survive, the storm sent by Allah SWT scared them away for good. 

On the other hand, with Tawakul in their hearts, Muslims fought with strategy and bravery. The army of Prophet Muhammad (PBUH) found shelter in their homes against the stormy desert winds.

As a result of this, the Banu al-Qurayza tribe surrendered unconditionally to the army of Prophet Muhammad (PBUH). This gave the Muslims of Madinah complete control of the Banu Qurayza neighborhoods and a chance to openly preach and spread Islam. 

Miracles During the Battle of the Trench

Just like other battles, the Battle of Trench played a pivotal role in the establishment of the Islamic community. The Muslim army bravely and strategically fought against 10,000 Qurayshi confederates. However, it would not have been possible without the blessings and miracles of Allah SWT. Some of the unexplainable events that took place during the Battle of Khandaq are as follows:

Miracle 1

Jabir (RA) narrated, “On the day of the battle of Al-Khandaq (the Trench), we were digging the trench when a very hard boulder came in our way. The Companions went to the Messenger of Allah (PBUH) and told him about it. He said, ‘I will go down the trench to see it.’ He stood up, and it was noticed that he had tied a stone over his stomach due to intense hunger. We had not tasted anything for three days.

He took up a spade and struck the hard rock with it, turning it into sand. I sought his permission to go home, (after reaching home), I said to my wife, ‘I have seen the Prophet (PBUH) in a state that I am unable to endure. Have you got anything in the house?’ She said, ‘I have a small quantity of barley and a lamb.’ I slaughtered the lamb, ground the barley, and put the meat in the cooking pot. Then I went to the Prophet (PBUH). In the meantime, the flour had been kneaded, and the meat in the pot was nearly cooked. I said to him, ‘O Messenger of Allah, I have some food, will you come along with one or two Companions?’ He asked, ‘How many men should go there?’ I told him the number. He said, ‘It will be better if they are more in number. Tell your wife not to remove the pot from the hearth nor the bread from the oven till I arrive.’ Then he said to the Muhajirun and the Ansar: ‘Let us go (to eat).’ They all rose (and went with him).

I went to my wife and said, ‘Bless you, the Prophet (PBUH), the Muhajirun, the Ansar, and the whole company are coming.’ She said, ‘Did he (PBUH) ask you?’ I replied in the affirmative. (When they arrived) Messenger of Allah (PBUH) said to his Companions, ‘Enter, but do not crowd in.’ Then he started breaking up the bread and putting meat on it. He would take from the pot, and the oven then would cover them up, approach his Companions and hand it over to them. He would then go back and uncover the pot and the oven. He continued to break up the bread and put meat on it till all had eaten to their fill and still some of the food remained. Then he said to my wife, ‘Eat from it, and send it as a present, for the people have been afflicted with severe hunger.'” (Al-Bukhari and Muslim)

Miracle 2

According to Islamic narrations, on the second day of the Battle of Trench, the Messenger (PBUH) of Allah SWT struck a gigantic rock. It is said that the moment Prophet Muhammad’s (PBUH) axe hit the rock, it broke into pieces, and a bright flash of white light was emitted.

The light was so bright that Muslims could see the palaces of Shaam. After the miracle, the Messenger (PBUH) of Allah SWT congratulated the Muslim army on upcoming victories over Syria, Yemen, and Persia. Today, Masjid Ra’yah is located in the place where this miracle took place. 

Miracle 3 

During the Battle of the Trench, while the Quraysh army was fighting bitter cold winds, Huzaifa said to Prophet Muhammad (PBUH), “I am trembling of cold, how I can cross the trench?” However, miraculously the Messenger’s (PBUH) body temperature got warmer, and he (SAW) easily crossed the trench, facing the Quraysh army bravely. 

Facts about the Battle of the Trench

The Battle of the Trench is an important battle in Islamic history and one that played a pivotal role in establishing Islam as the religion for generations to come. Listed below are some lesser-known facts about Ghazwah al-Khandaq:

  • The Battle of Trench took place in 5 AH, in the last week of Shawwal, and continued in Ramadan
  • When Prophet Muhammad (PBUH) learned that Abu Sufyan was leading an army of 10,000 soldiers toward Madinah, he (SAW) along with his companions came together to devise a defensive plan. 
  • Salman al-Farsi (RA) gave the idea to dig a trench around the northern border of the city (Madinah) as dense forests and mountains covered the other two sides. 
  • With high hopes and an empty stomach, it took the Muslims six days to dig a 5.5-kilometre-long, 9-metre-wide, and 4.5-metre-deep trench.
  • The miracle took place at Jabir’s (RA) residence. 
  • Because of the trench, the Quraysh army was unable to enter the city of Madinah. 
  • Mount Ra’yah (Mount Dhubab) was where the famous miracle took place. It was here that Prophet Muhammad (PBUH) struck a large rock, which broke into pieces, and emitted a bright white light. 
  • During the Battle of the Trench, Ali Ibn Talib (RA) succeeded in killing one of the top enemy commanders, Amr ibn ‘Abd al-Wudd al-‘Amiri. This helped the Muslim army regain charge of an area named Sila.
  • The Quraysh knew that they would have to come up with an alternative plan. So, the leader of Banu al-Nadir (Jewish tribe) went to Banu al-Qurayza (another Jewish tribe) and asked for their help. Even though Banu al-Qurayza had signed a treaty with the Muslims and helped them dig the trench, the moment Banu Nadir asked for help, Banu al-Qurayza betrayed the treaty and decided to attack. 
  • Banu al-Qurayaza then decided to attack Muslim children and women in the southern region of Medinah. When Prophet Muhammad (PBUH) learned about the attack, he immediately sent an army to protect them, which also resulted in keeping at bay the Banu al-Qurayaza.
  • An elderly man, Nuaym ibn Masud approached Prophet Muhammad (PBUH) and secretly disclosed that he had accepted Islam and that he wanted to help the Muslims. Prophet Muhammad (PBUH) advised him to strategically break the trust between the Banu al-Qurayza and the Quraysh confederates. 
  • Nuaym ibn Masud did as he was told. He went back and said to Banu al-Qurayza that in case the Muslims win, the Quraysh troops will easily escape, leaving the Jewish tribe to face hardships alone. He advised them that the wisest way to have assurance is to request the Quraysh to send some of their leaders as hostages to the Banu al-Qurayza.
  • On the flip side, Nauym ibn Masud went to the Quraysh and told them that Banu Qurayza had once again joined hands with the Muslims, and so they could not be trusted. This resulted in creating an environment of mistrust and doubts between the Banu Qurayza and Quraysh. 
  • It was Masjid al-Fatah where Prophet Muhammad (PBUH) prayed to Allah SWT for the victory of the Muslims. He (SWT) accepted his (SAW) prayers and sent down a strong storm that destroyed everything. 
  • This left the Quraysh and Banu al-Qurayza tribes helpless. They had no choice but to surrender and leave the battlefield. 
  • An army comprising 3000 Muslim soldiers succeeded in defeating 10,000 Quraysh men. This established a strong and powerful image of Prophet Muhammad (PBUH) in the Arabian Peninsula. 

Lessons from the Battle of the Trench

As stated earlier, Muslims won the Battle of the Trench very easily. The strategy and patience showcased by the Muslim army during the Battle of the Trench taught us to have faith in Allah SWT and believe that no matter what happens, the Almighty is watching over us, and the final outcome will be in our favour. In simpler words, having Tawakul (relying on Allah SWT) is essential as it ensures the preparation and preservation of an individual. 

When stuck in a difficult situation, remember that Prophet Muhammad (PBUH) and his companions were only victorious in Ghazwah al-Khandaq because they made all the necessary preparations, thought outside the box, and fought hard.

Not only this but the leadership and decision-making skills of Prophet Muhammad (PBUH) taught us the importance of having a strong leader in a time of crisis. 

Summary – Battle of the Trench

One thing that we know for sure is that the 30-day-long Battle of Trench played a decisive role in the establishment of Islam in the Arabian Peninsula.

With faith in Allah SWT, 3,000 Muslims fought strategically and bravely against the all-powerful Quraysh troops, resulting in the believers scaring away the idolaters and gaining complete control over the tribes of Banu al-Qurayza.

Explore The New Pilgrim App

The Ultimate App
for Hajj and Umrah!