The story of the place
The group of mosques known as The Seven Mosques is located west of the Prophet’s Mosque, along the slopes of Mount Sala‘. These sites are tied to the events of the Battle of the Confederates (Ahzab) in the fifth year of Hijrah, when Quraysh and the Arab tribes united to besiege Madinah. In response, the Prophet ﷺ and his Companions dug a protective trench around the city.
Allah says in the Qur’an:
"O you who have believed, remember the favor of Allah upon you when armies came to [attack] you and We sent upon them a wind and armies you did not see. And Allah is ever Seeing of what you do.
[Remember] when they came at you from above you and from below you, and when eyes grew wild and hearts reached the throats, and you assumed about Allah [various] assumptions.
There the believers were tested and shaken with a severe shaking."
(Surah Al-Ahzab, 33:9–11)
At the top of the mountain stands Al-Fath Mosque, where it is authentically reported that the Prophet ﷺ prayed and made dua against the Confederates for three days—from Monday to Wednesday—until his prayer was answered between Dhuhr and ‘Asr on Wednesday. He supplicated:
"O Allah, Revealer of the Book, Swift in reckoning, defeat the Confederates. O Allah, defeat them and shake them!"
Allah granted him victory and sent a wind to scatter the enemy forces.
Surrounding Al-Fath Mosque, several smaller mosques were later built and named after the Companions:
Salman Al-Farisi Mosque, where it is said Salman suggested digging the trench.
Abu Bakr Mosque
‘Umar Mosque
‘Ali Mosque
Sa‘d ibn Mu‘adh Mosque
These mosques were believed to mark the spots where these Companions stood guard during the siege.
Although referred to as the Seven Mosques, there are actually six. Some say the seventh refers to Masjid Al-Rayah, where the Prophet ﷺ ’s banner was raised; others say it is Masjid Banu Haram or even Masjid Al-Qiblatayn. However, the strongest opinion is that the seventh is a mosque located at the starting point of the trench on the northern side of Mount Sala‘.
These mosques were not built during the Prophet’s ﷺ lifetime. Their locations were designated in the first century AH, during the governorship of ‘Umar ibn ‘Abd al-‘Aziz, who commissioned a group of Tabi‘un (Successors) to identify the Prophet’s ﷺ prayer locations. Mosques were then constructed at these sites to preserve the historical memory.
In modern times, a large Trench Mosque (Masjid Al-Khandaq) was built to serve visitors, standing beside the smaller historic mosques—especially Al-Fath Mosque, which remains a powerful symbol of the Prophet’s ﷺ supplication and Allah’s answered victory.
Visiting information
- Best time to visit: 06:00 AM - 11:00 PM
- Suggested visit length: 30
- Show on the map







