When any of you enters the mosque, let him say: 'Allahumma iftah li abwāba rahmatik' (O Allah, open for me the gates of Your mercy). And when he leaves, let him say: 'Allahumma inni as’aluka min fadlik' (O Allah, I ask You of Your bounty)
Chapter: What to say when entering the masjid
Authentic
hadith of Sahih Muslim
Sahih Muslim 713a
Abu Humayd or Abu Usayd reported: The Messenger of Allah (may Allah’s peace and blessings be upon him) said:
"When any of you enters the mosque, let him say: 'Allahumma iftah li abwāba rahmatik' (O Allah, open for me the gates of Your mercy). And when he leaves, let him say: 'Allahumma inni as’aluka min fadlik' (O Allah, I ask You of Your bounty)."
Reported by Muslim (No. 713a), Abu Dawud (No. 465), An-Nasa’i (No. 729), Ahmad (No. 22502) and Ad-Darimi (No. 2575).
The Prophet (may Allah's peace and blessings be upon him) directed his Ummah to the supplication to be said upon entering the mosque: "O Allah, open for me the gates of Your mercy." He asks Allah Almighty to provide him with the means to attain His mercy. And when he wants to leave, he should say: "O Allah, I ask You of Your bounty." He asks Allah for His bounty and more of His benevolence in providing lawful sustenance.
Lessons
It is recommended to say this supplication upon entering the mosque and upon leaving it.
Mercy is mentioned in relation to entering, while bounty is in relation to leaving because when a person enters the mosque, he engages in deeds that bring him closer to Allah and His Paradise. So it is befitting to mention mercy, and when he leaves, he goes about in the land in pursuit of Allah's bounty of sustenance, and so the mention of bounty befits that.
These dhikrs are to be said upon entering the mosque and upon leaving it.
Explanation in Arabic
أَرْشَدَ النبيُّ صلى الله عليه وسلم أمَّتَه إلى الدّعاء الذي يقال عند دخول المسجد: (اللَّهُمَّ افْتَحْ لي أَبْوابَ رَحْمَتِكَ)، فيسألُ اللهَ تعالى أن يهيئ له أسباب رحمته، وإذا أراد الخروج فليقل: (اللَّهُمَّ إني أَسْأَلُك مِن فَضْلِكَ)، فيسألُ اللهَ مِن فضلِه ومَزيدِ إحسانِه من الرِّزقِ الحلالِ.
استحباب هذا الدعاء عند دخول المسجد والخروج منه.
تخصيص ذكر الرَّحمة بالدّخول، والفضل بالخروج: أنّ الدّاخل اشتغل بما يقرِّبه إلى الله وإلى جنته فناسَب أن يذكُر الرَّحمة، فإذا خرج سعى في الأرض ابتِغاء فضل الله مِن الرِّزق، فناسَب ذكر الفَضْل.
هذه الأذكار تقال عند إرادة دخول المسجد، وعند إرادة الخروج منه.
Authentic chainShu'ayb al-Arna'utإسناده صحيح على شرط مسلم — تخريج صحيح ابن حبان (2049)
Authentic chainShu'ayb al-Arna'utإسناده صحيح، رجاله ثقات رجال الصحيح — تخريج صحيح ابن حبان (2048)
Al-Dhahabiله طرق — المهذب في اختصار السنن (2/870)
Authentic chainAl-Nawawiإسناده صحيح، ورواه مسلم وليس في روايته السلام على النبي صلى الله عليه وسلم — خلاصة الأحكام للنووي (1/314)
Al-Bazzarلا نعلم أحداً يرويه بأحسن من هذا الإسناد، وروي من وجوه — البحر الزخار (9/170)
AuthenticIbn Hibbanأخرجه في صحيحه — صحيح ابن حبان (2049)
AuthenticIbn Hibbanأخرجه في صحيحه — صحيح ابن حبان (2048)
Al-Daraqutniتَفَرَّدَ بهِ عَبد الله بن وهب عن يحيى بن عَبد الله بن سالم عن عمارة بن غزية عن ربيعة بن أبي عَبد الرحمن، عَن عَبد الملك بن سعيد بن سويد الأنصاري، عَن أبي أسيد وأبي حميد . — أطراف الغرائب (2/195)
Al-Bayhaqiلفظة [التسليم] محفوظة — السنن الكبرى للبيهقي (2/441)
Abu Zur'ah al-Raziعن أبي حُمَيْدٍ وأبي أُسَيْدٍ -كِلاهما عن النَّبيِّ صلَّى اللهُ عليه وسلَّم- أَصَحُّ. — علل ابن أبي حاتم (509)
Weak chainعلاء الدين مغلطايإسناده ضعيف — شرح ابن ماجه لمغلطاي (3/216)
Authentic chainعبد الحق الإشبيليأشار في المقدمة أنه صحيح الإسناد — الأحكام الشرعية الصغرى (188)
عبد الحق الإشبيليسكت عنه [وقد قال في المقدمة: وإن لم تكن فيه علة كان سكوتي عنه دليلا على صحته — الأحكام الوسطى (1/ 298)
محمد ابن يوسف الصالحيأسانيده صحيحه — سبل الهدى والرشاد (12/447)
ابن أبي حاتمقالَ أبو زُرْعةَ: عن أبي حُمَيدٍ وأبي أُسَيْدٍ -كِلاهما عن النَّبيِّ صلَّى اللهُ عليه وسلَّم- أَصَحُّ. قُلْتُ [ابنُ أبي حاتِمٍ]: لم يكنْ أَخرَجَ أبو زُرْعةَ مَن خالَفَ بِشْرَ بنَ المُفضَّلِ في رِوايتِه عن عُمارةَ بنِ غَزِيَّةَ، وأَحسَبُ أنَّه لم يكنْ وَقَ — علل ابن أبي حاتم (509)
" إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ ـ صلى الله عليه وسلم ـ ثُمَّ لْيَقُلِ اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ . وَإِذَا خَرَجَ فَلْيَقُلِ اللَّهُمَّ إِنِّي أَسْأَلُكَ مِنْ…
"When any of you enters the mosque, let him send peace upon the Prophet and say: Allāhumma iftahli abwāba rahmatik (O Allah, open for me the gates of Your mercy). And when he leaves, let him send peace upon the Prophet and say: Allāhumma i‘simni min ash-shaytān ar-rajīm (O Allah, protect me from…
" إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ ـ صلى الله عليه وسلم ـ وَلْيَقُلِ اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ وَإِذَا خَرَجَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ وَلْيَقُلِ اللَّهُمَّ…