The Battle of Al-Khandaq, also known as the Battle of the Trench or the Battle of the Confederates, occurred in 5 Hijri (627 CE) in Medina. It was a pivotal siege where the Muslim community, led by Prophet Muhammad (PBUH), defended the city against a large coalition army formed by the Quraysh and allied tribes intent on eradicating Islam. The Muslims strategically dug a trench around Medina’s vulnerable northern side, a novel defensive measure suggested by Salman al-Farsi, which blocked the invaders’ cavalry and prevented direct storming of the city. Despite being heavily outnumbered—with about 3,000 Muslims facing 10,000 enemy soldiers—the Muslims endured a siege lasting about a month, ultimately forcing the enemy coalition to withdraw. The battle was a crucial Muslim victory that shifted power dynamics in the Arabian Peninsula and secured the survival of the Muslim community in Medina.
Background and Cause of the Battle
The battle was mainly instigated by the Banu Nadir, a Jewish tribe previously expelled from Medina for disloyalty to the Muslims. They went to Khaybar and conspired with the Quraysh, led by Abu Sufyan, to form a confederate army. The Quraysh, a prominent merchant tribe from Mecca, united with many Arab tribes, including Banu Ghatafan, Banu Sulaym, and Banu Asad, summoning a force between 7,500 and 10,000 men to attack Medina. The goal was to eliminate the Muslim threat and restore the Quraysh’s dominance. Although the Banu Qurayza tribe initially promised neutrality, they later violated their pact by siding with the confederates, thereby adding internal danger to the Muslim defense.
The battle of Al-Khandaq

Facing overwhelming odds, Prophet Muhammad consulted his companions on defense options. Salman al-Farsi, a Persian companion familiar with Persian military tactics, proposed digging a trench around Medina’s northern side. This had never been done in Arabian warfare before and served as a formidable barrier against the cavalry-centric forces of the enemy. The trench was approximately 5.5 kilometers long, 9 meters wide, and 4.5 meters deep, constructed over six days with the Prophet personally participating in the work.
Key Events of the Siege
When the confederate forces arrived, they were surprised to find the trench blocking their path, preventing a direct cavalry assault. The siege lasted around 30 days with repeated unsuccessful attempts by the enemy to cross the trench. The Muslims maintained strong patrols and defensive positions despite being heavily outnumbered. A famous event during the siege was when the enemy warrior Amr ibn Abd Wudd crossed the trench to challenge the Muslims to single combat. Ali ibn Abi Talib volunteered and killed him, boosting Muslim morale significantly.
The Role of Banu Qurayza and the Battle’s End
The Banu Qurayza tribe’s betrayal escalated the crisis, but the Muslims held steadfast. Eventually, worsening weather conditions, scarcity of supplies, and internal discord among confederate forces led to the withdrawal of the enemy coalition. The Muslims emerged victorious with minimal casualties—six martyrs—against higher losses for the confederates. Post-battle, the Muslims laid siege to Banu Qurayza, resulting in their surrender, with the men executed and women and children enslaved according to the customs of that time.
Read more: The battle of Waddan (1 Hijri)
Significance and Outcome
The Battle of Al-Khandaq was not only a military victory but also a strategic and psychological triumph for the Muslims. The innovative defensive tactic of digging the trench prevented a larger coalition from overwhelming Medina. It demonstrated the unity, resilience, and faith of the Muslim community under extreme pressure. The battle greatly weakened the Quraysh’s influence and trade, shifting power towards Medina and paving the way for significant subsequent Muslim victories and peace treaties. It is remembered as a testament to the power of strategy, faith, and perseverance in the face of daunting odds.
FAQs
Why was the Battle of Al-Khandaq also called the Battle of the Confederates?
It was called the Battle of the Confederates because the Quraysh tribe allied with several Arab tribes and the Jewish tribe of Banu Nadir to form a large confederate army aimed at eradicating Islam.
Who suggested the idea of digging the trench?
Salman al-Farsi, a companion of the Prophet Muhammad with knowledge of Persian defensive warfare, proposed digging a trench around Medina’s northern side.
How long did the trench siege last?
The siege lasted approximately one month, during which the confederate forces repeatedly attempted and failed to breach the trench defenses.
What was the significance of Ali ibn Abi Talib’s duel during the battle?
Ali’s defeat of the enemy champion Amr ibn Abd Wudd was a major morale booster for the Muslims, reinforcing their courage and faith under pressure.
What happened to the Banu Qurayza tribe after the battle?
The Banu Qurayza, who betrayed the Muslims by siding with the confederates, were besieged, surrendered, and faced severe punishment in line with contemporary customs, involving the execution of men and enslavement of women and children.
Conclusion
The Battle of Al-Khandaq in 5 Hijri stands as a historic moment reflecting the intelligence, courage, and unity of the early Muslim community under Prophet Muhammad’s leadership. Through strategic foresight—embodied by the unprecedented digging of the trench—the Muslims defended Medina against a superior enemy coalition. This victory was crucial for the survival of Islam in its formative years, significantly undermining the Quraysh and their allies. The battle’s legacy remains a powerful example of how resilience, faith, and smart strategy can overcome overwhelming challenges, securing a lasting place in Islamic history.

