Incited by the Jews and supported by the surrounding pagan tribes, the polytheists of Makkah prepared a massive force to strike a blow against Islam by attacking Madinah. Acting upon the suggestion of Salman al-Farisi (may Allah be pleased with him), the Prophet (peace and blessings be upon him) ordered the digging of a wide and deep trench stretching from the northeast to the west of Madinah. The Prophet himself took part in this work, during which certain points were designated as military positions.
The weakest point of the trench, which lay between Harrat Waqim and the Valley of Bathan, was left in front of Mount Sal‘. Camps were set up there, forcing the enemy to face this area, and the fighting took place at that location.
Later, during the governorship of ‘Umar ibn ‘Abd al-‘Aziz in Madinah (at the end of the first Hijri century), mosques were built at these military positions. These mosques are: Masjid al-Fath, Masjid Salman al-Farisi, Masjid ‘Ali, Masjid ‘Umar, Masjid Sa‘d ibn Mu‘adh, and Masjid Abu Bakr. Although there were never seven mosques in total, the area came to be known as “Masjid al-Sab‘ah” — the Seven Mosques.
