Skip to content
Assabile

Sunan Ibn MajahThe Book On The Mosques And The Congregations

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)

Chapter: Supplication When Entering The Mosque

Authentic 3 scholars’ grades Sunan Ibn Majah 773

Narrator:Abu Hurayrah

حَدَّثَنَا مُحَمَّدُ بْنُ بَشَّارٍ، حَدَّثَنَا أَبُو بَكْرٍ الْحَنَفِيُّ، حَدَّثَنَا الضَّحَّاكُ بْنُ عُثْمَانَ، حَدَّثَنِي سَعِيدٌ الْمَقْبُرِيُّ، عَنْ أَبِي هُرَيْرَةَ، أَنَّ رَسُولَ اللَّهِ ـ صلى الله عليه وسلم ـ قَالَ ‏

"‏ إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ ـ صلى الله عليه وسلم ـ وَلْيَقُلِ اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ وَإِذَا خَرَجَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ وَلْيَقُلِ اللَّهُمَّ اعْصِمْنِي مِنَ الشَّيْطَانِ الرَّجِيمِ ‏"

Abu Hurayrah (may Allah be pleased with him) reported that the Messenger of Allah (ﷺ) said:

"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 the accursed devil)." In another narration by Al-Hākim: "When he leaves, let him send peace upon the Prophet (ﷺ) and say: Allāhumma ajirni min ash-shaytān ar-rajīm (O Allah, save me from the accursed devil)."

Reported by Ibn Majah (No. 773).

Copy
Copy:
Report an error

Explanation

The Prophet (ﷺ) guided the Muslim, when entering the mosque, to send peace and blessings upon the Prophet (ﷺ) by saying: Allāhumma salli wa sallim ‘ala Muhammad (O Allah, send Your blessings and peace upon Muhammad), and then to say: Allāhumma iftahli abwāba rahmatik (O Allah, open for me the gates of Your mercy). And when he leaves, he should send peace upon the Prophet and say: Allāhumma i‘simni min ash-shaytān ar-rajīm (O Allah, protect me from the accursed devil). In another narration by Al-Hākim: And say: Allāhumma ajirni min ash-shaytān ar-rajīm (O Allah, save me from the accursed devil).

Lessons

  • It is recommended to say this supplication upon entering the mosque and upon leaving it.
  • This supplication is to be generally recited in all mosques, including the Sacred Mosque.
  • The specific mention of mercy when entering and seeking protection from the devil when exiting: The one entering is engaged in what brings him closer to Allah and His Paradise, so it is fitting to mention mercy. When exiting, he ventures into the world with its distractions and preoccupations, so it is appropriate to ask Allah for protection and preservation from the devil.

Explanation in Arabic

أرشد النبي صلى الله عليه وسلم المسلم إذا أراد الدخول إلى المسجد أن يسلم على النبي صلى الله عليه وسلم بقوله: اللهم صل وسلم على محمد، ثم ليقل: (اللهم افتح لي أبواب رحمتك).

وإذا خرج فليسلم على النبي وليقل: (اللهم اعصمني من الشيطان الرجيم)، وفي رواية للحاكم: وليقل: (اللهم أجرني من الشيطان الرجيم).

  • استحباب هذا الدعاء عند دخول المسجد والخروج منه.
  • الذكر عام في كل المساجد، حتى المسجد الحرام.
  • تخصيص ذكر الرَّحمة بالدُّخول، والعصمة من الشيطان بالخروج: أنّ الدَّاخل اشتغل بما يقرِّبه إلى الله وإلى جنته فناسَب أن يذكُر الرَّحمة، فإذا خرج فإنه ينطلق في الدنيا بما فيها من ملهيات ومشغلات، فناسب أن يطلب من الله الحماية والحفظ من الشيطان.

Classical commentary

Al-Sindi — Hashiyat al-Sindi on Sunan Ibn Majah

قَوْله ( وَلْيَقُلْ اللَّهُمَّ اِعْصِمْنِي إِلَخْ ) وَفِي الزَّوَائِد إِسْنَاده صَحِيح رِجَالُهُ ثِقَات.…

Read more

Scholars’ grades

ScholarGradeApplies toWork
Al-Albanid. 1420 AH AuthenticSahih The hadith No. 773
Zubair Ali Zaid. 1435 AH AuthenticSahih The hadith No. 773
Muhammad Fu'ad Abd al-Baqid. 1388 AH AuthenticSahih The hadith No. 773
Grades of other versions (3)
  • AuthenticAl-Albani صحيح — صحيح ابن ماجه (634)
  • Authentic chainIbn Baz إسناده صحيح — مجموع فتاوى ابن باز (26/38)
  • Muqbil al-Wadi'i ظاهره الحسن ولكن قال النسائي خالف ابن أبي ذئب الضحاك [يعني في روايته مرفوعا]وابن أبي ذئب أثبت — أحاديث معلة (434)

Other versions

Also reported by… (12)
  • أخبار أصبهان لأبي نعيم (1308)إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ ﷺ , وَلْيَقُلِ : اللَّهُمَّ افْتَحْ لَنَا أَبْوَابَ رَحْمَتِكَ , وَإِذَا خَرَجَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ مُحَمَّدٍ , وَلْيَقُلِ : اللَّهُمَّ اعْصِمْنِي مِنَ الشَّيْطَانِ
  • الأوسط في السنن والإجماع والاختلاف لابن المنذر (1202)إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ ﷺ ، وَلْيَقُلِ : اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ ، وَإِذَا خَرَجَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ ﷺ وَلْيَقُلِ : اللَّهُمَّ أَجِرْنِي مِنَ الشَّيْطَانِ الرَّجِيمِ
  • الدعاء للطبراني (390)إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ ﷺ ، ثُمَّ لِيَقُلِ : اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ ، وَإِذَا خَرَجَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ ﷺ ، وَلْيَقُلِ : اللَّهُمَّ افْتَحْ لِي أَبْوَابَ فَضْلِكَ
  • الدعاء للطبراني (391)إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ ﷺ ، وَلْيَقُلِ : اللَّهُمَّ اعْصِمْنِي مِنَ الشَّيْطَانِ الرَّجِيمِ
  • السنن الكبرى للبيهقي (3972)إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ ﷺ ، وَلْيَقُلِ : اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ ، وَإِذَا خَرَجَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ ﷺ ، وَلْيَقُلِ : اللَّهُمَّ أَجِرْنِي مِنَ الشَّيْطَانِ الرَّجِيمِ
  • السنن الكبرى للنسائي (9522)إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ ﷺ وَلْيَقُلْ : اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ ، وَإِذَا خَرَجَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ ﷺ وَلْيَقُلْ : اللَّهُمَّ بَاعِدْنِي مِنَ الشَّيْطَانِ
  • صحيح ابن حبان (2088)إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ فَلْيُسَلِّمْ عَلَى النَّبِيِّﷺ وَلْيَقُلِ : اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ ، وَإِذَا خَرَجَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ ﷺ ، وَلْيَقُلِ : اللَّهُمَّ أَجِرْنِي مِنَ الشَّيْطَانِ الرَّجِيمِ
  • صحيح ابن حبان (2091)إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ ، فَلْيُسَلِّمْ عَلَى النَّبِيِّ ﷺ ، وَلْيَقُلِ : اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ ، وَإِذَا خَرَجَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ ﷺ ، وَلْيَقُلِ : اللَّهُمَّ أَجِرْنِي مِنَ الشَّيْطَانِ الرَّجِيمِ
  • صحيح ابن خزيمة (446)إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ ، فَلْيُسَلِّمْ عَلَى النَّبِيِّ ، وَلْيَقُلِ : اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ ، وَإِذَا خَرَجَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ ، وَلْيَقُلِ : اللَّهُمَّ أَجِرْنِي مِنَ الشَّيْطَانِ الرَّجِيمِ
  • صحيح ابن خزيمة (2532)إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ ، فَلْيُسَلِّمْ عَلَى النَّبِيِّ وَلْيَقُلِ : اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ ، وَإِذَا خَرَجَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ ، وَلْيَقُلِ : اللَّهُمَّ أَجِرْنِي مِنَ الشَّيْطَانِ الرَّجِيمِ
  • عمل اليوم والليلة لابن السني (86)إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ أَوْ أَتَى إِلَى الْمَسْجِدِ فَلْيُسَلِّمْ عَلَى النَّبِيِّ ﷺ ، وَلْيَقُلِ : اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ ، وَإِذَا خَرَجَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ ﷺ ، وَلْيَقُلِ : اللَّهُمَّ أَعِذْنِي مِنَ الشَّيْطَانِ الرَّجِيمِ
  • مستخرج أبي عوانة (954)إِذَا جَاءَ أَحَدُكُمُ الْمَسْجِدَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ ﷺ ، وَلْيَقُلِ : اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ ، وَإِذَا خَرَجَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ ﷺ ، وَلْيَقُلِ : اللَّهُمَّ إِنِّي أَسْأَلُكَ مِنْ فَضْلِكَ

On the same subject

Authentic Sahih Muslim 713a

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)

"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)."

اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ ‏.‏ وَإِذَا خَرَجَ فَلْيَقُلِ اللَّهُمَّ إِنِّي أَسْأَلُكَ مِنْ فَضْلِكَ ‏"

Narrated by Abu Usayd + 5 other versions Explained

Authentic Sunan Ibn Majah 772

"The Messenger of Allah said: 'When anyone of you enters the mosque, let him send peace upon the prophet, then let him say: "Allahummaftah li abwaba rahmatika (O Allah, open to me the gates of Your mercy)." And when he leaves, let him say: "Allahumma inni as'aluka min fadlika. (O Allah, I ask of…

"‏ إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ فَلْيُسَلِّمْ عَلَى النَّبِيِّ ـ صلى الله عليه وسلم ـ ثُمَّ لْيَقُلِ اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ ‏.‏ وَإِذَا خَرَجَ فَلْيَقُلِ اللَّهُمَّ إِنِّي أَسْأَلُكَ مِنْ…

Narrated by Abu Humayd as-Sā‘idī + 2 other versions

Differing grades Sunan Ibn Majah 771

"Whenever the Messenger of Allah entered the mosque he would say: 'Bismillah, was-salamu 'ala Rasulillah, Allahummagh-firli dhunubi waftah li abwaba rahmatika. (In the Name of Allah, and peace be upon the Messenger of Allah. O Allah, forgive me my sins and open to me the gates of Your mercy).' When…

"‏ بِسْمِ اللَّهِ وَالسَّلاَمُ عَلَى رَسُولِ اللَّهِ اللَّهُمَّ اغْفِرْ لِي ذُنُوبِي وَافْتَحْ لِي أَبْوَابَ رَحْمَتِكَ ‏"‏ ‏.‏ وَإِذَا خَرَجَ قَالَ ‏"‏ بِسْمِ اللَّهِ وَالسَّلاَمُ عَلَى رَسُولِ اللَّهِ اللَّهُمَّ…

Narrated by Fātima + 6 other versions

Topics

Thursday, October 15, 2026 4 جمادى الأولى 1448 هـ