The Seven Mosques of Madinah: history and how to visit
Where the Battle of the Trench was fought: the story behind the Seven Mosques, Masjid al-Fath and Salman al-Farisi, and how to visit.
3 min read

The Seven Mosques are a group of small mosques on the western slope of Mount Sal' in Madinah, beside the ground where the trench was dug in the Battle of the Trench. They are a regular stop on ziyarat tours, the visit is short, and it is the clearest place in the city to picture those days.
The story of the Trench
In the fifth year of the Hijrah, Quraysh and allied tribes gathered to besiege Madinah. Salman al-Farisi advised digging a trench across the open side of the city, and the Muslims dug it together. The battle is named after it, and is also called the Battle of the Confederates (al-Ahzab). Allah recalls it in Surat al-Ahzab: "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 ever is Allah, of what you do, Seeing" (Al-Ahzab 33:9).
The Prophet ﷺ made du'a against the confederates:
«اللَّهُمَّ مُنْزِلَ الكِتَابِ، سَرِيعَ الحِسَابِ، اهْزِمِ الأَحْزَابَ، اللَّهُمَّ اهْزِمْهُمْ وَزَلْزِلْهُمْ»
"O Allah, Revealer of the Book, swift in reckoning, defeat the confederates. O Allah, defeat them and shake them" (al-Bukhari and Muslim).
What you will see
- Masjid al-Fath is the largest and highest of them, also called the mosque of the Confederates. Sources say it stands where the Prophet ﷺ had his place of prayer during the siege.
- The Mosque of Salman al-Farisi stands about 20 metres south of it, named for the companion who proposed the trench.
- Between them are small mosques attributed to Abu Bakr, Umar, Ali and Fatimah.
- They are built of plain volcanic stone. Sources say they date to the time Umar ibn Abd al-Aziz governed Madinah and were renewed several times, most recently under King Fahd.

Why "seven"?
Sources disagree. Many count six and add Masjid al-Qiblatayn to reach seven, and some tours count Masjid al-Rayah. Some of the small mosques were merged or removed in rebuilding, so you may not find seven buildings standing. Take the name as the popular one. For Masjid al-Qiblatayn, read our guide to it.
How to visit
- It is about 2 km from the Prophet's Mosque by the city's official tourism site; other guides give a longer distance. A taxi takes a few minutes.
- The mosques are open through the day. Ask about the hours before you go, as they can change.
- Half an hour is enough.
- Visiting is not part of Umrah and no act of worship is tied to it. Reports differ on exactly where the Prophet ﷺ stood or prayed, so treat the spots as markers of history. For any ruling, ask a scholar.
Winter, December to February, is the easiest season for walking between ziyarat sites: Madinah's daytime highs run from 24 to 27 °C, as in Makkah and Madinah weather by month. If you go in summer, go after Asr.

Put them in one morning with Quba Mosque and Mount Uhud, and find the rest of the city's sites in the ziyarat in Madinah.
Hotels near the Prophet's Mosque
Compare the walk, the view and the price, then book in minutes.
See the hotelsSources
- Quran 33:9: the armies at the Trench · Checked 28 Nov 2026
- Sahih al-Bukhari 2933: the Prophet's du'a against the confederates · Checked 28 Nov 2026
- Visit Madinah: The Seven Mosques · Checked 28 Nov 2026
- Saudipedia (Arabic): المساجد السبعة · Checked 28 Nov 2026
- Madain Project: al-Fatah Mosque (Seven Mosques) · Checked 28 Nov 2026
- Wikipedia: The Seven Mosques · Checked 28 Nov 2026


