Residence in the Mosque: Shari‘ah Ruling & Etiquettes in the Light of Authentic Ahadith
This excerpt is taken from Sheikh Muḥammad Munīr Qamar’s book Aḥkām al-Masājid.
Fatwa Context
Our respected teacher, Maulana Ḥāfiẓ Thanāʾullāh Madanī (Shaykh al-Ḥadīth, Jāmiʿah Islāmiyyah, Lahore) issued a fatwa published in al-Iʿtiṣām. It is reproduced here—along with the original question—for general benefit.
Question
A man dedicated the plot adjacent to his house for a mosque and asked another man to collect funds for its construction. The latter collected donations in various areas and had a two-storey mosque built, with a gallery between the two floors. The ground floor and the gallery were for men, and the second floor for women.
This man had lived in a rented house earlier. On the second floor where women prayed, he persuaded the management to let him build two rooms, and he has been living there with his family for five years.
He also owns a private house at half a furlong from the mosque (constructed some time ago)—a four-marla house with all facilities—but he refuses to move there. When people object, he excuses himself by claiming service of the mosque, saying no one else can serve as he does.
Interestingly, the one who leads the prayers has a room next to the mihrab (on the first floor), where the imam resides. In addition, the electricity, water, and gas connections are shared, and their bills are paid from mosque funds, increasing the mosque’s expenses. When this shared-utilities setup is criticized, he again cites the excuse of service.
In the light of the Qur’an and Sunnah, please explain: May such a person build a residence on the mosque’s second floor, or may anyone reside in a mosque with his family without necessity—complete with a latrine? (A questioner)
Answer (al-jawāb bi-ʿawn al-Wahhāb)
Since Islam lays strong emphasis on the purity and cleanliness of mosques, nothing should be done in them that contradicts their sanctity, honor, or etiquette, or suggests demeaning their status. In Ṣaḥīḥ Muslim there is the ḥadīth:
إن هذه المساجد لا تصلح لشيء من هذا البول ولا القذر وإنما هي لذكر الله وقراءة القرآن
Meaning: It is not proper to spread urine, filth, or impurities in mosques; rather, they are built solely for Allah’s remembrance and recitation of the Qur’an.
Muslim – Mukhtaṣar Muslim with al-Mundhirī, ḥadīth 186
On this basis, Imām al-Nawawī رحمه الله states:
ويكره أن يجعل المساجد مقعد الحرفة كالخياطة ونحوها
Meaning: Turning the mosque into a regular base for a trade/craft like sewing, etc., is impermissible.
al-Majmūʿ 3/192
However, incidental occurrences carry no harm.
ʿUmar رضي الله عنه saw two men from Ṭāʾif raising their voices in the Prophet’s Mosque, and said:
لو كنتما من أهل المدينة لأوجعتكما
Meaning: “Had you been from the people of Madinah, I would have punished you for this act.”
Out of respect for the mosque, ʿUmar رضي الله عنه had a gathering place built on one side of the mosque and named it Buṭiḥāʾ. Whoever wished to converse, recite poetry, or raise his voice would be sent there.
رواه المالك والبيهقي
In Ṣaḥīḥ Muslim it is stated that if someone is heard seeking a lost animal in the mosque, one should respond:
إن المساجد لم تبن لهذا
Meaning: “May you not find it—for mosques were not built for this purpose.”
Muslim with Nawawī 513, 541
The Messenger of Allah صلى الله عليه وسلم further said:
لا تقام الحدود فى المسجد ولا يستقاد فيها
Meaning: Ḥudūd are not to be established in the mosque, nor qiṣāṣ carried out therein.
Aḥmad; Abū Dāwūd; Dār Quṭnī; Ṣaḥīḥ al-Tirmidhī 1130; Ibn Mājah 2099; al-Mustadrak (al-Ḥākim) 14/360; Dār Quṭnī 184
This ḥadīth is proven and strong due to corroborating reports.
al-Mishkāh (al-Albānī) 1/229
In view of masjid etiquette, the Prophet صلى الله عليه وسلم closed all doors of the Companions رضي الله عنهم that opened into the mosque, except in exceptional cases. Ḥāfiẓ Ibn Ḥajar رحمه الله, commenting on the ḥadīth, writes:
وأن المساجد تصان عن التطرق إليها لغير ضرورة مهمة
Meaning: Mosques must be safeguarded from being approached/used for anything other than a significant necessity.
Fatḥ al-Bārī, vol. 7, p. 15
In light of the above narrations, it can be said without hesitation that residing in a mosque inevitably leads to numerous issues and unavoidable daily necessities, making it impossible to preserve the sanctity and honor of the mosque. Therefore, using “service of the mosque” as a pretext to compromise its dignity is not correct. Service can be performed excellently while living outside—what prevents that?
Hence, the individuals mentioned in the question should choose a separate residence, or a place adjacent to the mosque that does not affect its sanctity. In particular, the owner should focus on settling in his own house, so that he benefits properly from Allah’s blessing.
As for shared utilities, this matter can be settled with the administration’s consent, according to an agreed arrangement between the parties.
al-Iʿtiṣām, vol. 44, no. 20, 12 Dhū al-Qaʿdah 1412 AH / 5 May 1992