Al-Rayah Mosque

Also known as Masjid Dhubab, Al-Rayah Mosque is a small mosque which marks the site on which the Prophet ﷺ pitched his tent prior to the Battle of the Trench

Medinah Sharif, Saudi Arabia

Coordinates: 24.480245, 39.603407

Al-Rayah Mosque (Mosque of the flag), or Dzubab Mosque, is a mosque located in Medinah sharif, Saudi Arabia.

The mosque is situated on top of Mount Dzubab (Dzubab means “flies”), and this area is not far from Mount Sala’ on the south, Al-‘Uyun street on the left hand side, and Az-Zugaibi gas station between Al-‘Uyun street and Sulthanah street on the behind.

It is narrated that there was a command post (tent/shade) pitched for Prophet Muhammad ﷺ in this area at the time of the Battle of the Trench, so it was named as Al-Rayah, which means battle flag.

On this site A flag was raised as a signal for Jihad and a Khaimah (tent) or Qubbah was built for Prophet ﷺ over a small mountain (called Dhubab), from where he could see the Sahabah digging the trench.

Incident of Striking the Rock

Near the Qubbah, a huge very hard rock was discovered which was broken into pieces striking by Prophet ﷺ three times. There was a flash of light with each strike and he ﷺ smiled every time and said “With the first one Allah has granted me Syria, I can see its red palaces now. With the second, I have been given the keys to Persia, I can see the white palace of al Mada’in, and with the third I have been given the keys to Yemen, I can now see the gates of Sanaa from my place here”.

Another Name

The mosque is also called the Dzubab Mosque because it is attributed to a Yemeni man who came to Medinah Sharif during the time of Governor Marwan bin al-Hakam and killed one of the government officials. He was later executed and crucified on Mount Dzubab.


The mosque was first built during the reign of Hz. Umar bin Abdul Aziz رضي الله عنه, with a small square with an area of 61 square meters and a height of 5 meters.

After being destroyed in the 10th century, it was rebuilt by the governor Janbek in the 16th century.


It is a beautiful small Mosque up on a tiny hill, hidden between other buildings; you have to go up by stairs. Located in between Abu Bakr Siddique (رضي الله عنه) and Usman bin Affaan (رضي الله عنه) road on right hand side.

Later some years back while digging for construction of houses people found fresh bodies of two Sahabah in the same locality.

Do not miss this Mosque when you happened to be in Holy Madinah.