The Ruling on Locking Mosque Doors | Jurisprudential Evidence and Scholarly Opinions
This excerpt is taken from Shaykh Muhammad Munir Qamar’s book Ahkām al-Masājid.
Locking the Doors of Mosques
One of the rulings regarding mosques is whether it is permissible to lock their doors during times other than prayer.
The ḥadīth collections clearly mention that while constructing a mosque, provision could be made for doors and even their locks and latches. Although these references are implicit, they indicate allowance. For example, in Ṣaḥīḥ al-Bukhārī, under one chapter heading, it is narrated from Ibn Jurayj that Ibn Abī Mulaykah said to him:
لو رأيت مساجد ابن عباس وأبوابها
“O ʿAbd al-Malik ibn Jurayj, if you had seen the mosques built by Ibn ʿAbbās (may Allah be pleased with him) and their doors, you would have realized how clean and well-maintained they were.”
(Bukhārī 559/1)
Not only ordinary mosques, but even the door of the Sacred Kaʿbah is mentioned. In Ṣaḥīḥ al-Bukhārī, Muslim, and other ḥadīth sources, Ibn ʿUmar (may Allah be pleased with him) narrated that:
The Prophet ﷺ, Usāmah ibn Zayd, Bilāl, and ʿUthmān ibn Talḥah (may Allah be pleased with them) entered the Sacred Kaʿbah.
فأغلقوا عليهم الباب فلما فتحوا كنت أول من ولج
“They closed the door upon themselves. When they opened it, I was the first to enter.”
(Bukhārī 559/1, 463/3)
This establishes that the Kaʿbah had a door, and the Prophet ﷺ along with his Companions closed it from inside.
Imam al-Bukhārī placed this narration under two headings:
- باب الأبواب والغلق للكعبة والمساجد (Chapter: On doors and locks for the Kaʿbah and mosques)
- باب إغلاق البيت (Chapter: Closing the doors of the Kaʿbah)
Thus, the existence of doors and even locking them is established. The question, however, remains: is it permissible to lock mosques at times other than prayer?
First Opinion: Prohibition of Locking Mosques
There is no explicit ḥadīth evidence allowing locking mosques outside of prayer times. On the contrary, some Ḥanafī jurists considered it makrūh (disliked).
- In Sharḥ al-Kifāyah, Samīrī reports that Imam Abū Ḥanīfah (رحمه الله) forbade locking mosque doors at any time.
- Imam al-Nawawī (رحمه الله) cited this opinion in Rawḍat al-Ṭālibīn and affirmed it.
(Reference: Iʿlām al-Masājid of al-Zarkashī, p. 340)
The Ḥanafīs based this on the Qur’ān, Sūrah al-Baqarah verse 114:
﴿وَمَنْ أَظْلَمُ مِمَّن مَّنَعَ مَسَاجِدَ اللَّهِ أَن يُذْكَرَ فِيهَا اسْمُهُ وَسَعَىٰ فِي خَرَابِهَا﴾
“And who is more unjust than one who prevents the mosques of Allah from His remembrance being mentioned therein, and strives for their ruin?”
This verse condemns every individual who prevents others from worship and remembrance in mosques. It applies generally to all mosques, not only Masjid al-Ḥarām or Masjid al-Aqṣā, nor only to the disbelievers of Quraysh. Hence, by locking mosques and restricting people from worship, one risks falling under this condemnation.
Therefore, caretakers should avoid locking mosques and instead appoint a guardian or servant (khādim) to watch over them and their property (such as carpets, fans, sound systems, etc.) so that mosques remain open for worshippers at all times.
Second Opinion: Conditional Permissibility of Locking Mosques
However, in practice, many mosques cannot afford permanent guardians. Theft and burglary risks are real and have existed for centuries. Even Imām al-Zarkashī (d. 794 AH) acknowledged that while in the time of the Salaf mosques could remain unlocked, later circumstances made it necessary to lock them to prevent theft and crime.
Thus, according to the second opinion, in times and places where crime is prevalent, it is permissible to lock mosques outside of prayer times — for example, from sunrise to midday, and after ʿIshā’ until Fajr. This is also the practice in Arab countries today. Even those scholars who preferred the first opinion sometimes implemented the second in cities due to necessity.
Imām al-Ḥadīth Shaykh Sayyid Nadhīr Ḥusayn al-Dehlawī (رحمه الله) issued a fatwa:
- Locking mosques without necessity is prohibited.
- Locking them out of fear of theft, while ensuring no hindrance to remembrance of Allah, is permissible.
(Fatāwā Nadhīriyyah 1/256; Fatāwā ʿUlamāʾ Ahl al-Ḥadīth 2/95)
In Arab countries, regulations require that:
- Mosques open at least 10–15 minutes before prayer.
- Remain open at least 20–30 minutes after prayer.
- Only then may they be locked.
Guidelines for Imams, Mu’adhdhins, and Caretakers
① Imams and mu’adhdhins must ensure mosques open well before prayer and remain open for a reasonable time afterwards. Closing too early due to personal convenience is a mistake for which they bear responsibility.
② Where mosques employ servants or doormen, they should follow Imām Tāj al-Dīn al-Subkī’s advice in Muʿīd al-Niʿam:
- The doorman should sleep near the door so he can open it if someone comes for tahajjud or late-night worship.
- Once the door is closed after ʿIshā’, refusing entry to someone genuinely seeking worship is impermissible.
③ Al-ʿAllāmah Jamāl al-Dīn al-Qāsimī (رحمه الله) wrote in Iṣlāḥ al-Masājid:
- Closing mosque doors without necessity is unanimously impermissible.
- They may be locked at night due to real security concerns.
- However, if locked, the caretaker must remain nearby to open the door when needed, otherwise his salary is unlawful.
Conclusion
- Without necessity: locking mosque doors is impermissible and falls under the Qur’anic condemnation of preventing remembrance of Allah.
- With necessity (fear of theft, security concerns): it is permissible, provided mosques remain open sufficiently before and after prayers, and caretakers remain available to facilitate worshippers.
