Islamic Guidelines on Closing Mosques: Maintenance and Community Considerations
An-Nawawi raḥimahullāh states:
«لا بأسَ بإغلاقِ المسجدِ في غيرِ وقتِ الصلاة لصيانته أو لحفظِ آلاته، هكذا قالوه، وهذا إذا خِيفَ امتهانُها وضَياعُ ما فيها ولم تَدْعُ إلى فتحِها حاجةٌ؛ فأمَّا إذا لم يُخَفْ مِنْ فتحِها مَفْسَدةٌ ولا انتهاكُ حُرْمَتِها وكان في فتحِها رِفْقٌ بالناس فالسُّنَّةُ فتحُها، كما لم يُغْلَقْ مسجدُ رسول الله ﷺ في زمنه ولا بَعْدَه»
“There is no harm in closing the masjid outside of prayer times for maintenance or to safeguard its equipment. This is what has been stated, and it applies when there is concern that the masjid may be disrespected or its contents lost, and THERE IS NO NEED TO KEEP IT OPEN. However, if no harm or disrespect is feared from keeping it open, and doing so would be beneficial to the people, then it is preferable to leave it open, as the masjid of the Messenger of Allāh ﷺ was not closed during his time, nor after him.”
[المجموع (٢/ ١٧٨)]
If there is no valid reason to close the masjid or prevent worshippers, it is feared that such people will fall into the following threats:
﴿وَمَنۡ أَظۡلَمُ مِمَّن مَّنَعَ مَسَـٰجِدَ ٱللهِ أَن یُذۡكَرَ فِیهَا ٱسۡمُهُۥ وَسَعَىٰ فِی خَرَابِهَا…الآية﴾
"And who are more unjust than those who forbid that Allāh’s Name be glorified and mentioned much (i.e. prayers and invocations, etc.) in Allāh’s Masjids and strive for their ruin?..." [Sūrah Al-Baqarah: 114]
﴿إِنَّ ٱلَّذِینَ كَفَرُوا۟ وَیَصُدُّونَ عَن سَبِیلِ ٱللهِ وَٱلۡمَسۡجِدِ ٱلۡحَرَامِ ٱلَّذِی جَعَلۡنَـٰهُ لِلنَّاسِ سَوَاۤءً ٱلۡعَـٰكِفُ فِیهِ وَٱلۡبَادِۚ وَمَن یُرِدۡ فِیهِ بِإِلۡحَادِۭ بِظُلۡمࣲ نُّذِقۡهُ مِنۡ عَذَابٍ أَلِیمࣲ﴾
"Indeed, those who have disbelieved and avert [people] from the way of Allāh and [from] al-Masjid al-Ḥarām, which We made for the people - equal are the resident therein and one from outside - and [also] whoever intends [a deed] therein of deviation [in religion] by wrongdoing - We will make him taste of a painful punishment." [Sūrah Al-Ḥajj: 25]
﴿أَرَءَیۡتَ ٱلَّذِی یَنۡهَىٰ (*) عَبۡدًا إِذَا صَلَّىٰۤ﴾
“Have you seen those who forbid. A servant when he prays?” [Sūrah Al-’Alaq: 9-10]
NOTE: Although these Āyāt were revealed regarding disbelievers, the principle states:
العبرة بعموم اللفظ لا بخصوص السبب
“The lesson is drawn from the generality of the wording, not the specificity of the cause.”