Dua for entering masjid: O Allah, open for me the gates of Your mercy

Dua for Entering Masjid and Leaving It: The Authentic Words

You take off your shoes, push the door open and step inside. The Prophet ﷺ taught a short line for that exact moment. This is the dua for entering masjid from Sahih Muslim, the dua for leaving it, and the other authentic words he added at the mosque door.

At a glance

  • Source: Sahih Muslim 713 (also Abu Dawud 465 and 466, Ibn Majah 773)
  • Narrated by: Abu Humaid or Abu Usaid al-Ansari
  • Grade: Sahih (Muslim)
  • Topic: What to say when entering and leaving the masjid
  • Practise it: Say it at the door on your next visit, then pray two rak‘ahs before you sit

The dua for entering masjid

Abu Humaid or Abu Usaid al-Ansari (may Allah be pleased with them) reported it. The narrator was not sure which of the two Companions he heard it from, so Imam Muslim kept both names. The Prophet ﷺ said:

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

“When any one of you enters the mosque, let him say: ‘O Allah, open for me the gates of Your mercy.’ And when he goes out, let him say: ‘O Allah, I ask You of Your bounty.’”

Muslim 713 · Narrated by Abu Humaid or Abu Usaid · Translation adapted from Sunnah.com

That gives us two short lines to learn. The first is for going in:

اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ

Allahumma-ftah li abwaba rahmatik

O Allah, open for me the gates of Your mercy.

Muslim 713 · Narrated by Abu Humaid or Abu Usaid · Translation adapted from Sunnah.com

The second is the dua for leaving masjid:

اللَّهُمَّ إِنِّي أَسْأَلُكَ مِنْ فَضْلِكَ

Allahumma inni as’aluka min fadlik

O Allah, I ask You of Your bounty.

Muslim 713 · Narrated by Abu Humaid or Abu Usaid · Translation adapted from Sunnah.com

What to say first, and more words at the door

Other narrations of the same hadith add one step before the dua: sending peace on the Prophet ﷺ.

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

“When any one of you enters the mosque, let him send peace on the Prophet ﷺ, then let him say: ‘O Allah, open for me the gates of Your mercy.’ And when he goes out, let him say: ‘O Allah, I ask You of Your bounty.’”

Abu Dawud 465 · Sahih (al-Albani) · Narrated by Abu Humaid or Abu Usaid al-Ansari · Translation adapted from Sunnah.com

The same wording is in Ibn Majah 772 and an-Nasa’i 729, both graded Sahih by Darussalam.

‘Abdullah ibn ‘Amr ibn al-‘As (may Allah be pleased with him) reported that when the Prophet ﷺ entered the masjid, he would seek refuge in Allah with these words:

أَعُوذُ بِاللَّهِ الْعَظِيمِ وَبِوَجْهِهِ الْكَرِيمِ وَسُلْطَانِهِ الْقَدِيمِ مِنَ الشَّيْطَانِ الرَّجِيمِ

A’udhu billahil-‘azim, wa bi-wajhihil-karim, wa sultanihil-qadim, minash-shaytanir-rajim

I seek refuge in Allah the Magnificent, in His noble Face and His eternal authority, from Shaytan the accursed.

Abu Dawud 466 · Sahih (al-Albani) · Narrated by ‘Abdullah ibn ‘Amr · Translation adapted from Sunnah.com

The narration goes on: when a person says this, Shaytan says, “He is protected from me for the rest of the day.”

A note on its grading

Sunnah.com lists Abu Dawud 466 as Sahih (al-Albani). The Encyclopedia of Translated Prophetic Hadiths grades it Hasan (HadeethEnc 8294). Both grades mean it is acceptable to act on. The English heading on Sunnah.com names Haiwah ibn Shuraih, a later narrator; the Companion is ‘Abdullah ibn ‘Amr.

Abu Hurayrah (may Allah be pleased with him) reported a version that also gives words for leaving:

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

“When any one of you enters the mosque, let him send peace on the Prophet ﷺ and say: ‘O Allah, open for me the gates of Your mercy.’ And when he goes out, let him send peace on the Prophet and say: ‘O Allah, protect me from Shaytan the accursed.’”

Ibn Majah 773 · Sahih (Darussalam) · Narrated by Abu Hurayrah · Translation adapted from Sunnah.com

What it means

Why mercy going in and bounty going out? The explanation on HadeethEnc 3097 says the masjid is a place of worship that brings a person closer to Allah’s mercy and to Paradise, so mercy fits the way in. Leaving, a person goes back out to seek lawful provision, so asking for Allah’s bounty fits the way out.

Reflection: The door of the masjid is a line between two parts of the day. One short dua on each side reminds us that both are in Allah’s hands: the prayer we are about to pray, and the work we go back to.

How to practise it

  • Learn the two lines first. Mercy going in, bounty going out. They are short enough to learn on the walk to the masjid.
  • Send peace on the Prophet ﷺ before the dua. The hadith does not fix the wording, so any short salawat or salam on him fits.
  • Add the words of refuge when you can. The A’udhu billahil-‘azim dua is the one the Prophet ﷺ said on entering, as a guard against Shaytan for the day.
  • Pray two rak‘ahs before you sit. The Prophet ﷺ told us to do this in Bukhari 444; see our guide to Tahiyyatul Masjid.
  • Teach it to your children. This is a suggestion, not something stated in the hadith, but a dua when entering the mosque is an easy first dua for them to learn.

Questions people ask

Is there a dua for leaving the masjid?

Yes. In Sahih Muslim 713 the Prophet ﷺ taught “Allahumma inni as’aluka min fadlik” (O Allah, I ask You of Your bounty). Ibn Majah 773, graded Sahih by Darussalam, also has “Allahumma-‘simni minash-shaytanir-rajim” (O Allah, protect me from Shaytan the accursed).

Which foot should I enter the masjid with?

Many Muslims enter with the right foot and leave with the left. The authentic general guidance is that the Prophet ﷺ liked to start with the right in all his affairs (Bukhari 426). We have not used a separate narration about the masjid door here; ask a qualified local scholar for the details.

What about “Bismillah, was-salamu ‘ala Rasulillah, Allahummaghfir li dhunubi”?

This version, narrated from Fatimah (may Allah be pleased with her), is in Ibn Majah 771 and Tirmidhi 314. Both are graded Da’if (Darussalam) on Sunnah.com, so we have not used it. The Sahih wording is the one in Muslim 713.

Key lessons

Dua for entering masjid: key lessons – key lessons card, Muslim 713 · Abu Dawud 466

Part of our Dua series: see all our dua articles in one place.

Next time you reach the masjid door, pause for a breath and ask for His mercy. On the way out, ask for His bounty. May Allah open those gates for all of us.

Save this to Pinterest so you can say it at the masjid door

Dua for Entering Masjid and Leaving It: The Authentic Words – Pinterest pin, Sahih Muslim 713

Share the reward. Send this article to someone who needs it today — teaching a hadith or dua can become a lasting good deed for you, in shaa Allah.

Similar Posts