The Battle of the Trench () took place in the year 627; it was a 27-day-long defense by Muslims of Yathrib (now Medina) from Arab and Jewish tribes. The strength of the confederate armies is estimated at around 10,000 men with six hundred horses and some camels, while the Medinan defenders numbered 3,000. The largely outnumbered defenders of Medina, mainly Muslims led by the Islamic prophet Muhammad, dug a trench on the suggestion of Salman the Persian, which, together with Medina's natural fortifications, rendered the confederacy's cavalry (consisting of horses and camels) useless, locking the two sides in a stalemate. Hoping to make several attacks at once, the confederates persuaded the Muslim-allied Medinan Jews, Banu Qurayza, to attack the city from the south. However, Muhammad's diplomacy derailed the negotiations, and broke up the confederacy against him. The well-organized defenders, the sinking of confederate morale, and poor weather conditions caused the siege to end in a fiasco. The siege was a "battle of wits", in which the Muslims tactically overcame their opponents while suffering very few casualties. Efforts to defeat the Muslims failed, and Islam became influential in the region. As a consequence, the Muslim army besieged the area of the Banu Qurayza tribe, leading to their surrender. The defeat caused the Meccans to lose their trade and much of their prestige. Name The battle is named after the "Trench", or khandaq, that was dug by Muslims in preparation for the battle as an act of defense. The word khandaq () is the Arabised form of the Middle Persian word kandag (; meaning "that which has been dug"). Salman the Persian advised Muhammad to dig a trench around the city. The battle is also referred to as the Battle of Khandaq () and Battle of Confederates (). The Qur'an uses the term confederates () in to denote the confederacy of non-believers and Jews against Islam. What occurred before? After their migration from Mecca, the Muslims fought the Meccan Quraysh at the Battle of Badr in 624, and at the Battle of Uhud in 625. Although the Muslims neither won nor were defeated at the Battle of Uhud, their military strength was gradually growing. In Sha'ban AH 4 (October 625) Muhammad raised a force of 300 men and 10 horses to meet the Quraysh army of 1,000 at Badr for the second time. Although no fighting occurred, the coastal tribes were impressed