Masjid al-Jinn (Arabic: مسجد الجن), also known as Masjid al-Bay’ah (Arabic: مسجد البيعة) or Masjid al-Haras (Arabic: مسجد الحرس), is a mosque located on the site where a group of Jinn embraced Islam after hearing the Quran. It is within walking distance from Masjid al-Haram and close to the Jannatul Mualla cemetery and Masjid al-Shajarah.
Significance of Masjid al-Jinn
This location holds significance as the site where a group of Jinn, upon hearing the recitation of the Quran, embraced belief in the message of the Prophet Muhammad ﷺ. Within the mosque, a specific spot is recognized as “The Place of the Writing” (Maudua al-Khatt; Arabic: موضع الخط), where the Prophet ﷺ documented this event.
Its Names
- Masjid al-Jinn (Arabic: مسجد الجن; ”Mosque of the Jinn”): The name that it’s most commonly known as. It derives its name from the event where a group of Jinn listened to the recitation of the Quran by the Prophet ﷺ and embraced Islam.
- Masjid al-Bayah (Arabic: مسجد البيعة ; “Mosque of the Pledge of Allegiance”): Another name attributed to this mosque is the Masjid al-Bayah. It was so named because it was at this location where the jinn gave bay’ah or pledged allegiance to the Prophet Muhammad ﷺ. There is also another historical mosque called Masjid al-Bayah in Makkah.
- Masjid al-Haras (Arabic: مسجد الحرس; “Mosque of the Guard”): This name dates back to the beginning of the third century AH, due to its association with the guards and nightwatchmen responsible for maintaining public order in Makkah. They would convene at Masjid al-Jinn, making it a central meeting point and change shifts therein.
The Prophet’s ﷺ Encounter with the Jinn
Ibn Jurayj mentions in his Tafsir that Abdullah ibn Masud I narrated:
The Prophet ﷺ went out to the Jinn to recite the Quran and invite them to Allah. Turning to his Companions, he asked, ‘Who will join me? Who among you lacks even a speck of pride in his heart to accompany me?’ He was met with silence. Twice more he posed the question, until Abdullah ibn Masud rose. He recounted, ‘I accompanied the Messenger of Allah ﷺ towards al-Hujun until we reached Abu Dhub. There, the Prophet ﷺ marked a boundary for me, saying, ‘Do not cross it.’ Thereafter, the Jinn descended upon him like locusts. He recited the Quran aloud, causing them to fall and stick to the ground until they were invisible to me. They demanded, ‘Who are you?’ He answered, ‘A Prophet!’ They questioned, ‘Who will testify for you?’ He pointed to a tree, which came forth dragging its branches and making sounds, testifying to his prophethood before retreating. Requesting provision, the Prophet ﷺ offered the Jinn bones and animal fodder. Astonishingly, they found the bones softer than meat and the fodder sufficient for their beasts. Henceforth, the Prophet ﷺ prohibited the use of bones and dung for cleansing after relieving oneself.
The Prophet ﷺ drew a boundary for me, instructing, ‘Stay within this boundary and do not venture into the mountains.’ I heard loud, strange sounds, which I wanted to investigate, yet I remained within the prescribed boundary, recalling the Prophet’s ﷺ command. Upon his return, I recounted my experience, to which he remarked, ‘Had you strayed beyond the boundary, I wouldn’t have seen you again.’
In another narration, Abdullah ibn Masud mentions the following about the encounter. Abu Uthman an-Nahdi narrated from ibn Masud who said:
The Messenger of Allah ﷺ performed the Isha prayer, then he turned and took the hand of Abdullah ibn Masud until he led him to the wide valley of Makkah. He sat him down and drew a line around him, saying: ‘Do not cross this line, for some men will approach you, but do not engage with them, for they will not speak to you.’
He continued, ‘Then the Messenger of Allah ﷺ went to his intended destination, while I remained seated within the marked boundary. Soon, men resembling Az-Zut (a dark-skinned people, possibly from North Africa or India) in appearance, with hair and bodies that showed neither nakedness nor covering, approached me but did not cross the line. Eventually, they returned to the Messenger of Allah ﷺ. As the night neared its end, the Messenger of Allah came back to me while I was still seated. He said, ‘I have been awake all night,’ then he entered the marked boundary with me and reclined on my thigh to sleep.’
[Narrated in Sunan al-Tirmidhi]
In another narration, Abdullah ibn Masud mentions the following encounter with the Jinn. On this occasion, he mentions that he wasn’t present with the Prophet ﷺ. The narration is as follows:
Ash-Sha’bi narrated that ‘Alqamah said: “I asked Ibn Masud, may Allah be pleased with him, ‘Did any of you accompany the Prophet ﷺ on the Night of the Jinn?’ He replied, ‘None of us did. One night, while he was in Makkah, we couldn’t find him. We feared he might have been murdered or abducted. We spent the most dreadful night until morning, or it was dawn when we finally saw him returning from the direction of Hira. He continued, ‘We told him about our ordeal.’
He ﷺ responded, ‘Someone from the Jinn invited me, so I went to recite for them.’ He added, ‘We went and saw their tracks and the remnants of their campfire.’ Ash-Sha’bi remarked, ‘They asked him about their provisions – they were Jinns from Mesopotamia – and he replied, every bone not sanctified with Allah’s name that falls into your hands, and every piece of dung, is fodder for your beasts.’
So the Messenger of Allah ﷺ said, ‘Do not perform istinja with them, for indeed they are provisions for your brothers among the Jinns.’
[Narrated in Sunan al-Tirmidhi]
How Many Times Did the Prophet ﷺ Meet the Jinn?
Allamah Shihab al-Din al-Khafaji mentions that reliable Hadiths confirm that Jinn delegations met the Prophet ﷺ a total of six times.
As the Prophet ﷺ had multiple meetings with the Jinn, it allows us to reconcile the different Hadiths about these encounters.
Revelation of Surah al-Jinn
The incident mentioned above occurred before the revelation of Surah al-Jinn, so this encounter at the location of Masjid al-Jinn, where it stands today, isn’t the reason for the revelation of this Quranic chapter. There are differing opinions about the actual events related to Surah al-Jinn’s revelation.
First Opinion
According to the Tafsir of ibn Jurayj, Surah al-Jinn was revealed in the tenth year after Prophethood after his mission to Ta’if. As he was leaving Ta’if, disheartened by the response of the people of Thaqif to his call to Islam, a group of Jinn encountered him while he was at Nakhlah during his journey back to Makkah. Sa’id ibn Jubayr’s account from Abdullah ibn Abbas L, is as follows:
The Prophet Muhammad ﷺ embarked on a journey with some of his companions towards the Ukaz market, passing by al-Nakhla. The devils were unable to eavesdrop from the heavens, and shooting stars were cast upon them. They lamented to one another, ‘A barrier has been placed between us and heavenly news.’ They replied, ‘It’s due to an earthly phenomenon.’
It is recounted that they were conversing with Iblis, who said to them, ‘Explore the East and the West of the earth so you may grasp what has occurred.’ Subsequently, a faction among them journeyed through Tihama and beheld the Prophet ﷺ and his companions praying Fajr in the Valley of al-Nakhla, reciting the Quran. Astonished, they exclaimed, “By Allah! This is the reason for the barrier between us and heavenly news.” They returned to their kin, proclaiming, ‘O People! We have encountered an astonishing Quran that illuminates the path of righteousness, and we have embraced it. We shall never associate partners with our Lord.’
The following verse was revealed because of this encounter:
قُلْ أُوحِىَ إِلَىَّ أَنَّهُ ٱسْتَمَعَ نَفَرٌۭ مِّنَ ٱلْجِنِّ فَقَالُوٓا۟ إِنَّا سَمِعْنَا قُرْءَانًا عَجَبًا ❁
Say [Prophet], ‘It has been revealed to me that a group of jinn once listened in and said, “We have heard a wondrous Quran.”
[Surah al-Jinn, 72:1]
It is reported that these were the Jinns belonging to the tribe of Nusaybin. Scholars have varying opinions regarding the location of the Nusaybin, differing on whether it is situated in Yemen or between the Levant and Iraq.
Ibn al-Jawzi, in his book Sifat al-Safwa, relayed a narration through a chain of transmission from Sahl ibn Abdullah, who said:
I found myself in the territory of the land of ʿAd when I stumbled upon a city constructed of intricately carved stones. At its heart stood a palace built of stones, serving as the dwelling place of the Jinn. Upon entering, I beheld an elderly man of remarkable stature engaged in prayer facing the Kaaba. He was draped in a woollen cloak adorned with patches. What struck me more than his imposing presence was the worn state of his cloak. Upon greeting him, he reciprocated and then spoke, ‘Sahl, this cloak has been my companion for seven hundred years. I encountered both Isa S and Muhammad ﷺ and embraced faith in them while wearing it.’ Intrigued, I inquired, ‘Who are you?’ He replied, ‘I am one of those to whom it was revealed: ‘Say, it has been revealed to me that a group of the Jinn listened and said, ‘We have heard a wondrous Quran that guides to the right path, and we have believed in it. We will never associate anything with our Lord.’ They were a group of Jinn from Nusaybin.
Second Opinion
According to the Tafsir of Ibn Kathir, the above incident is related to the revelation of the verse 49:29, rather than the verses of Surah al-Jinn. Ibn Sa‘d mentions that the Prophet ﷺ was not aware of the presence of the Jinn, when they were listening until the following verse was revealed:
وَإِذْ صَرَفْنَآ إِلَيْكَ نَفَرًۭا مِّنَ ٱلْجِنِّ يَسْتَمِعُونَ ٱلْقُرْءَانَ فَلَمَّا حَضَرُوهُ قَالُوٓا۟ أَنصِتُوا۟ ۖ فَلَمَّا قُضِىَ وَلَّوْا۟ إِلَىٰ قَوْمِهِم مُّنذِرِينَ ❁
We sent a group of jinn to you [Prophet] to listen to the Quran. When they heard it, they said to one another, ‘Be quiet!’ Then when it was finished they turned to their community and gave them warning.
[Surah al-Ahqaf, 46:29]
Ibn Kathir highlights that the revelation of Surah al-Jinn likely occurred during the early stages of Prophethood and is not tied to a singular encounter with the Jinn.
And Allah knows best.
Other Meetings with Jinn
It is mentioned in al-Shifa by Qadi Iyad that Umar ibn al-Khattab I said:
While we were in the company of the Prophet ﷺ, an elderly man holding a staff approached and greeted the Prophet ﷺ. The Prophet ﷺ returned the greeting and inquired, ‘You possess the voice of the Jinn. Who are you?’ He identified himself as Hama ibn al-Haym ibn Laqis ibn Iblis. He mentioned that he met with prophets preceding Prophet Muhammad ﷺ, including Nuh Q. The Prophet ﷺ then taught him certain chapters of the Quran.
Some scholars have classified this Hadith as being weak in transmission.
Development of Masjid al-Jinn

In the works of 9th-century Makkan historians al-Azraqi and al-Fakihi, during the 3rd century AH (9th century CE) there is mention of the place where the Prophet Muhammad ﷺ met with the Jinn, though there was no mention of a building at this location.
According to Qutb al-Din al-Nahrawali al-Makki, in the second half of the 10th century AH (16th century CE), the site where the Prophet met with the Jinn was renowned, yet there was no structure present on it.
Additionally, the Moroccan traveller Abu-Salim al Ayyashi, who visited the site on 5 Dhul-Hijjah 1072 (July 22, 1662), described the area as wooded and mentioned that food was distributed to the poor next to it.
In 1112 AH (1700 CE), during the Ottoman era, heavy torrential rain led to Masjid al-Jinn being buried under the ground. In the years that followed, foliage grew over the site. Builders eventually excavated the area, revealing the buried mihrab of the mosque. The area was cleared, and a small mosque was constructed, preserving the original mihrab. A dome was erected over the mosque, and another larger mosque was later built on top of it, with running water being installed nearby.
Masjid al-Jinn Today
Masjid al-Jinn has undergone several renovations and reconstructions over the years. Its current structure, as it stands today, was completely reconstructed in the year 1421 AH (2000).
The mosque stands out for its architectural design, characterized by the use of blocks and reinforced concrete in its construction. With an area spanning approximately 500 square meters, it can accommodate about 350 worshippers.
As well as the main prayer room for men. the mosque also features a prayer hall for women on, which covers an area of about 130 square meters. There are washing facilities for women to the west of the mosque.
In addition, the mosque includes dedicated spaces for the imam and the muezzin, as well as accommodation for the caretaker.
The minaret of the mosque stands to the northeast, reaching approximately 28 meters above ground level. The mosque has two entrances: one situated on the northern side, granting access to the prayer hall, while the other, found on the western side, provides entry to the women’s washing facilities and the caretaker’s quarters.
Features of the Mosque
- Prayer Hall: Positioned as the central element of the mosque, the prayer hall spans an area of approximately 270 square meters. It is rectangular in shape and has a hemispherical dome. Inside, there is a mihrab and pulpit on the Qibla wall, flanked by numerous windows on the eastern and western walls. It also contains accommodation for the imam and muezzin.
- Women’s Prayer Room: Situated north of the main prayer hall, the women’s prayer room occupies a rectangular space covering around 130 square meters. It comprises a closed hall with nine rectangular windows on each side, along with a glass window on the southern wall offering a view of the main prayer hall. Next to this space lies a designated area for elderly worshippers to rest.
- Mihrab and Pulpit: The mihrab, situated centrally on the Qibla wall within the prayer hall, features a hollow design covered in granite, flanked by a granite frame. Next to it, the pulpit protrudes about a metre from the wall.
- Doors: Masjid al-Jinn has various doors throughout its premises, including iron, wooden, single-leaf, and double-leaf doors.
- Windows: A total of 42 rectangular glass windows adorn the mosque. Specifically, the men’s prayer hall has 21 windows, while the women’s prayer hall features 9, and the minaret houses 12.
- Roof: The mosque’s roof comprises two distinct sections: the first, situated above the men’s prayer room, features a concrete slab with a hemispherical dome adorned with Quranic verses in the middle. The second part, located above the women’s prayer hall, consists of a straight concrete slab.
Masjid Jinn to Haram Distance
On foot, the distance from Masjid al-Jinn to Masjid al-Haram is about one kilometre.
By car, the distance is about three kilometres.
How to Visit Masjid al-Jinn
Masjid al-Jinn is located within walking distance of Masjid al-Haram. If you’re already inside Masjid al-Haram, exit from the mosque through Marwa Gate. Alternatively, if you’re starting from the front of the mosque near the clock tower, walk around it towards its rear, ensuring that Masjid al-Haram and the masa’a are on your left side. Continue walking straight past the Birthplace of the Prophet Muhammad ﷺ, which should be on your right, until you reach a flyover. Walk underneath the flyover and continue straight on the road lined with shops on both sides. You will first pass Masjid al-Shajarah and then you will see Masjid al-Jinn. Jannatul Mualla is just beyond this.
Alternatively, you can take a taxi from near Masjid al-Haram. The taxi fare should range from 10 to 15 riyals and may be slightly higher during busy periods. Please be aware that the taxi will need to take a longer route due to the road layout, as it cannot cut through Masjid al-Haram like you could if you were walking. Nevertheless, the journey should take less than 10 minutes.
Every year my husband and I been going with you Umrah. We enjoy it a lot. Can't wait to go again Mar/2013. Insha Allah.