The Battle of Khandaq, also known as the Battle of the Trench, took place in 627 CE during the time of the Prophet Muhammad. This battle was significant as it involved a coalition of tribes, including the Quraysh, who sought to defeat the early Muslim community in Medina. To defend the city, the Muslims dug a trench around it, a strategy suggested by the Persian general Salman the Persian.
The trench effectively thwarted the attackers, leading to a prolonged siege. The coalition forces faced difficulties due to the harsh weather and lack of supplies, ultimately resulting in their retreat. This victory strengthened the position of the Muslims and marked a turning point in their struggle for survival.