Masjid al-Rayah, Madinah: The Command Post Above the Trench

Short answer
Masjid al-Rayah, the Mosque of the Banner, stands on Jabal Dhubab about 1,300 metres north of Masjid an-Nabawi and is also called Masjid Dhubab. The sources record that the Prophet ﷺ pitched his tent here to oversee the digging of the trench, and that a mosque was first built on the spot under Umar ibn Abd al-Aziz. Visiting is not a rite of Hajj or Umrah.
Key takeaways
- ✓The mosque sits on Jabal Dhubab, about 1,300 metres north of Masjid an-Nabawi, on the side the confederate armies approached from.
- ✓The sources record that the Prophet ﷺ pitched his tent here to oversee the digging of the trench. The view from the hill explains the choice.
- ✓It is also called Masjid Dhubab. Use both names with a driver, and say Madinah, because there is another Masjid al-Rayah in Makkah.
- ✓Accounts also associate the site with the banner at Khaybar and Tabuk, but with the wording 'it is said'. Treat those as traditional.
- ✓The famous story of Salman's rock and the three strikes is not in Bukhari or Muslim. It is in the seerah literature and its grading is discussed.
- ✓The siege itself is established beyond doubt. Describing the rock story honestly costs you nothing and keeps the rest credible.
- ✓A mosque was first built here under Umar ibn Abd al-Aziz as governor. What stands today is a small modern building.
Quick facts
- City
- Madinah, on Jabal Dhubab
- Also called
- Masjid Dhubab
- Distance
- About 1,300 m north of Masjid an-Nabawi
- Marks
- The command position overseeing the trench
- First built
- Under Umar ibn Abd al-Aziz as governor
- The rock story
- Not in Bukhari or Muslim. Grading discussed
- Part of Umrah or Hajj
- No
- Can a car reach it
- Yes
- Time to allow
- About 10 minutes
- Evidence level
- A for the siege; B for the position; C for the banner claims
Masjid al-Rayah, the Mosque of the Banner, stands on Jabal Dhubab about 1,300 metres north of Masjid an-Nabawi. It is also called Masjid Dhubab, after the hill.
It is small, it is on high ground, and it marks the place where the Prophet ﷺ is recorded as pitching his tent to oversee the digging of the trench.
Why the hill
The logic is obvious once you are standing there. Jabal Dhubab is a modest hill on the north side of the city, on the side the confederate armies were coming from.
From the top you can see the ground the trench had to cover. That is why a command position was set there, and why the mosque built later marks it.
For the siege itself, see our article on the Battle of the Trench.
The banner
The name comes from the reports that the Prophet's ﷺ banner was placed here.
Published accounts also associate the site with his banner during Khaybar and Tabuk. Those associations are reported with the wording "it is said", and we are passing them on the same way: traditional, not established. If someone states them as fact, they have gone past their source.
The story of the rock
The account attached to this site is well known. While digging, Salman al-Farsi struck a rock that would not break. The Prophet ﷺ came, struck it three times, and it split, and with each strike he spoke of a future opening: Persia, Rome, Yemen.
This is worth handling carefully, because it is repeated everywhere as though it were in Bukhari.
It is not in Bukhari or Muslim. It is reported in the seerah literature and in some of the wider hadith collections, and scholars have discussed the strength of the chains. Some accept it; others grade it weak.
Our position: report it as what it is. A famous account from the historical literature, whose grading is discussed, about a siege that is itself established beyond doubt. You lose nothing by describing it that way, and you keep your credibility.
The mosque
The sources record that a mosque was first built here during the period Umar ibn Abd al-Aziz governed Madinah, on the spot where the Prophet ﷺ stood to supervise the work. The same governor is credited with building several of Madinah's small historic mosques, which tells you something about how deliberately the city's memory was marked out in that period.
What stands today is a small modern building on that site.
Not the Makkan one
There is also a Masjid al-Rayah in Makkah, with its own history connected to the conquest of the city. Different place entirely. Say Madinah when you ask, or say Masjid Dhubab.
Is visiting part of Hajj or Umrah?
No. Not a rite of either, and no prescribed prayer or reported reward attaches to it.
Visiting
- Ten minutes. Small building, quick stop.
- The view is the point. From the hill you can read the northern approach, which is what the site is about.
- Use both names with your driver: al-Rayah, or Dhubab.
- Combine it with the Trench area and Mount Sela', which are on the same side of the city.
Nearby
- The Battle of the Trench — the siege this position oversaw.
- Mount Sela' — the other high ground of the siege.
- Masjid Salman al-Farsi — the man whose idea it was.
- Madinah Ziyarat guide — the full list with evidence levels.
Getting there
Madinah's smaller historic sites are scattered, and reaching them one taxi at a time turns a short list into a whole morning. Our Madinah Ziyarat private car covers the round on one fixed fare for the whole vehicle with the driver waiting at every stop, and the Madinah Ziyarat tour is the guided version. For arrival, the Madinah airport transfer has fixed fares.
Accuracy note
The Battle of the Trench is established in the Qur'an, in Surah al-Ahzab, and in the hadith literature. The record that the Prophet ﷺ pitched his tent on Jabal Dhubab to oversee the digging, and that a mosque was first built on the spot during the period Umar ibn Abd al-Aziz governed Madinah, comes from the historical literature and published heritage sources; this is level B documentation. The association of the site with the Prophet's ﷺ banner at Khaybar and Tabuk is reported with the wording "it is said" and we have passed it on as traditional rather than established. The account of Salman al-Farsi striking an unbreakable rock, the Prophet ﷺ splitting it in three strikes and speaking of future openings, is not in Sahih al-Bukhari or Sahih Muslim; it appears in the seerah literature and in some of the wider hadith collections, and scholars differ over the strength of its chains. We have said so rather than presenting it as a sound narration. There is a separate Masjid al-Rayah in Makkah with a different history. The location about 1,300 m north of Masjid an-Nabawi follows published sources. Visiting is not a rite of Hajj or Umrah. Content verified August 2026. Something wrong? Tell us.
Frequently asked questions
Planning a Saudi trip?
Pre-book a private car, find a stay, or ask us anything on WhatsApp.
Last updated: 18 September 2026·Sources reviewed by the Wadana Go editorial team.





