Dua for Entering and Leaving the Mosque

Every visit to the mosque has a beginning and an end, and the Sunnah frames both of them with a short, beautiful dua. As a believer steps into the mosque, he asks Allah to open for him the gates of His mercy. As he steps back out, he asks Allah for His abundance and grace. Two sentences, each only a few words long, yet together they turn an ordinary walk through a doorway into an act of worship that starts with Allah’s mercy and ends with Allah’s bounty.

These duas are not long, and they are not difficult. A child can memorise them in a day, and an adult can carry them for a lifetime. What they need is understanding: what exactly did the Prophet ﷺ teach us to say, in which words, and what do those words mean? This article gathers the authentic texts exactly as they are recorded — the dua for entering the mosque, the dua for leaving it, their Arabic wording, their transliteration and their meanings — so that the next time you reach the door of the masjid, the words are already on your tongue. And because a mosque visit is built around the prayer itself, you may also appreciate our article on the importance of salah, which these doorway duas surround like a frame.

1. The Mosques Belong to Allah

Before the duas themselves, it helps to remember whose house the mosque is. Allah says in the Quran:

“and that masājid (mosques) belong to Allah; so, do not invoke anyone along with Allah,” (Quran 72:18)

The mosques belong to Allah. A person entering one is not entering a public hall or a community centre; he is entering a place that Allah has claimed for Himself, a place where no one is invoked alongside Him. That single fact explains the tone of the duas at the door. A guest does not wander into someone’s house unannounced and unthinking — and the greatest of houses deserves the greatest of manners. The dua for entering the mosque is exactly that: the words of a guest who knows whose door he is standing at.

The Quran describes what these houses are for:

“(The guided people worship Allah) in the houses that Allah has permitted to be raised, and where His name is recounted and His purity is pronounced, in the morning and in the evening,” (Quran 24:36)

The houses are raised so that Allah’s name is recounted in them, morning and evening. Remembrance is the heartbeat of the mosque. This is why the believer’s first words at the door are words of remembrance and request, not of worldly talk. He is stepping into a house of dhikr, and so he begins with dhikr — asking the Owner of the house to open His mercy to him before he takes another step. If you want to build that same rhythm of remembrance into the start of your day, our morning azkar collection follows the same morning-and-evening pattern this verse describes.

2. First, Send Blessings on the Prophet ﷺ

The fullest narration of the doorway duas includes a step that comes before the dua itself. Abu Usaid al-Ansari reported that the Messenger of Allah ﷺ said:

“when any of you enters the mosque he should invoke blessing on the prophet (ﷺ) and then he should say: O Allah, open to me the gates of thy mercy.” (Sunan Abu Dawud 465 — Sahih)

Notice the order in this narration: first, invoke blessing on the Prophet ﷺ; then, say the dua for entering the mosque. The one who taught us these words is honoured before the words he taught are spoken. There is something fitting in that sequence. The believer is about to ask Allah for mercy, and he begins by sending blessings on the one through whom this teaching reached him.

This detail appears in the narration of Abu Dawud, and it is worth holding on to because it is so easy to rush past. Arriving at the mosque, a person may be hurried, distracted, or thinking about where to stand and whom he will meet. The narration slows him down at the threshold: blessings first, then the request. In a single breath, the door of the mosque becomes a place of gratitude as well as a place of asking. Only after honouring the Messenger ﷺ does the worshipper turn to his own need and ask for the gates of mercy to be opened to him.

3. The Dua for Entering the Mosque

Here is the dua itself, in the Arabic words taught by the Prophet ﷺ:

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

Allahumma iftah li abwaba rahmatik

“O Allah, open to me the gates of thy mercy.”

Abu Usaid al-Ansari reported the Messenger of Allah ﷺ as saying:

“when any of you enters the mosque he should invoke blessing on the prophet (ﷺ) and then he should say: O Allah, open to me the gates of thy mercy.” (Sunan Abu Dawud 465 — Sahih)

The same teaching is recorded in Sahih Muslim. Abu Usaid reported that the Messenger of Allah ﷺ said, when any one of us enters the mosque, he should say:

“O Allah! open for me the doors of Thy mercy” (Sahih Muslim 713a — Sahih)

Two collections, one teaching. The wording in Muslim’s narration — “open for me the doors of Thy mercy” — matches the request in Abu Dawud’s narration, where the worshipper says “O Allah, open to me the gates of thy mercy.” Doors or gates, the picture is the same: Allah’s mercy is pictured as a place with entrances, and the one arriving at the mosque asks for those entrances to be opened to him personally. He does not simply walk in; he asks to be let in — let into mercy.

Look at the words once more. The dua does not ask for the mosque’s doors to open; those are already open, or someone has opened them. It asks for the doors of Allah’s mercy to open. The physical door is crossed in a second, but the real entry the worshipper wants is entry into mercy — and that door only Allah can open. This is what makes the dua so much larger than its few words. Every arrival at the mosque, whether for one of the five prayers, for a Friday sermon, or for a quiet moment between the world’s noise, begins with the same request: O Allah, open to me the gates of Thy mercy.

It is also worth noticing how personal the dua is. “Open to me” — the worshipper speaks for himself, by himself, even if he is entering in a crowd of a hundred people. Each person at the door carries his own need, his own week, his own sins and hopes, and the dua lets each one of them ask, in the first person, for mercy to be opened to him. Nobody can say this sentence on another’s behalf; at the door of the mosque, every believer stands alone before Allah with these words.

4. Why Mercy at the Door?

The pairing of words in these duas is not accidental, and it rewards a moment’s thought. On entering, the request is for mercy. The worshipper is coming into the house of Allah to worship — and worship, prayer and remembrance are the places where a believer hopes most directly for Allah’s mercy to reach him. Before he has prayed a single unit, before he has recited a single verse, he announces what he has really come for. Not recognition, not routine, not the company of people — mercy.

There is humility in asking for mercy before doing anything at all. The dua is said at the threshold, at the very start, which means the worshipper’s first declaration inside the house of Allah is that he needs mercy to be opened to him. He does not present his deeds at the door; he presents his need. Then, having entered on those terms, everything he does inside — the prayer, the recitation, the quiet sitting — unfolds under the mercy he asked for at the entrance.

The verse quoted earlier gives this a beautiful backdrop. The houses of Allah are where His name “is recounted and His purity is pronounced, in the morning and in the evening” (Quran 24:36). Remembrance fills the mosque from morning to evening, and the one who enters joins that remembrance. Asking for the gates of mercy at the door is, in effect, asking to be included among those who remember Allah in His houses — to have one’s own small arrival counted within that great, daily gathering of mercy. For more on what remembrance itself earns a believer, see our article on the virtues of dhikr.

5. The Dua for Leaving the Mosque

Every entry has an exit, and the Sunnah gives the exit its own dua. Here it is in Arabic:

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

Allahumma inni as’aluka min fadlik

“O Allah, I ask thee out of Thine abundance.”

Abu Usaid al-Ansari reported the Messenger of Allah ﷺ as saying:

“And when he goes out, he should say: O Allah, I ask thee out of Thine abundance.” (Sunan Abu Dawud 465 — Sahih)

And in the narration of Sahih Muslim, when a person steps out, Abu Usaid reported that the Messenger of Allah ﷺ taught him to say:

“O Allah! I beg of Thee Thy Grace.” (Sahih Muslim 713a — Sahih)

“Abundance” in one narration, “Grace” in the other — the Arabic word behind both is fadl, the generous bounty of Allah that goes beyond what anyone has earned. The worshipper who is leaving does not ask for a wage, calculated and owed. He asks out of Allah’s abundance, from the overflow of a Lord who gives more than His servants deserve. The word itself carries the same humility as the entry dua: at the door going in, he asked for mercy; at the door going out, he asks for grace. Neither request presents a claim. Both present a need, addressed to a Lord who delights to give.

Notice, too, that the leaving dua is just as deliberate as the entering dua. It would be easy to treat the prayer as finished the moment it ends — to step out of the mosque already absorbed in the phone, the traffic, the shop, the office. The Sunnah does not let the visit close that way. The last thing the worshipper does at the mosque is speak to Allah, asking Him for His abundance; and so the world he walks back into is entered through a dua, just as the mosque was. The visit is wrapped in supplication at both ends.

6. Mercy Going In, Abundance Coming Out

Place the two duas side by side and a pattern appears that is easy to carry in the heart:

Coming in: “O Allah, open to me the gates of thy mercy.” (Sunan Abu Dawud 465 — Sahih) Going out: “O Allah, I ask thee out of Thine abundance.” (Sunan Abu Dawud 465 — Sahih)

Inside the mosque, the believer’s hope is fixed on mercy — the mercy that receives worshippers, accepts their prayers and covers their shortcomings. Outside the mosque lies the rest of life: family, work, earning, travel, difficulty and ease. For all of that, the departing worshipper asks for Allah’s fadl, His abundance and grace, which sustains a person in every part of life and not only in the moments of prayer. The two requests divide the world beautifully between them. Nothing a believer needs falls outside one of the two doors: mercy for the worship he is about to offer, abundance for the life he is about to resume.

There is also a quiet lesson in the fact that the leaving dua is shorter in its picture but no smaller in its meaning. The entering dua asks for gates to be opened — many gates, a wide welcome. The leaving dua asks simply “out of Thine abundance” — from the abundance itself, without limit or measure specified. The worshipper does not name an amount, a thing or a deadline. He leaves the size of the gift to the Giver, and walks out trusting that what comes from Allah’s abundance will be exactly what he needs. Few sentences teach contentment as efficiently as this one does.

And all of this takes perhaps ten seconds at each door. The Sunnah is generous with small doors into great meanings: a sentence arriving, a sentence departing, and between them a prayer offered in a house that belongs to Allah, where His name is recounted morning and evening. Whoever guards these two small sentences guards the frame of every mosque visit he will ever make.

7. Two Narrations That Agree

These doorway duas reach us through Abu Usaid, and they are recorded in more than one collection. We have already quoted the narration in Sunan Abi Dawud, which includes the instruction to invoke blessing on the Prophet ﷺ before the entry dua, and the narration in Sahih Muslim, which gives the pair of duas in the Prophet’s ﷺ own words of instruction. Sahih Muslim also carries a further narration confirming the same report:

“A hadith like this has been narrated from the Messenger of Allah (ﷺ) by Abu Usaid.” (Sahih Muslim 713b — Sahih)

“A hadith like this” — the same teaching, carried by the same Companion, arriving by another route. For the ordinary believer, the benefit of this agreement is simple confidence. The words he says at the door of the mosque are not a single isolated report that might be wondered about; they are a teaching preserved in both Sahih Muslim and Sunan Abi Dawud, in wording that matches at every essential point: blessings and mercy on the way in, abundance and grace on the way out. He can say them with a settled heart.

It also means the duas are easy to verify for anyone who wishes to check them — and checking is a habit worth building with every dua one adopts. The references are printed beside every quote in this article for exactly that reason: Sahih Muslim 713a and 713b for the pair of duas in Muslim’s collection, and Sunan Abu Dawud 465 for the fuller narration that adds the sending of blessings before the entry dua. What you say at the mosque door, you can trace to its source in under a minute.

8. Making the Two Duas a Habit

Knowledge becomes worship when it reaches the tongue at the right moment, so it is worth thinking about how these two short duas actually take root in a life.

The simplest method is to attach each dua to its doorway in your memory by its key word. Entering is mercy: picture the gates of mercy as you approach the mosque’s entrance, and the sentence Allahumma iftah li abwaba rahmatik belongs to that picture. Leaving is abundance: as you turn toward the exit, the sentence Allahumma inni as’aluka min fadlik belongs to the world you are walking back into. Mercy in, abundance out — the pairing is itself the memory aid, and it comes straight from the texts.

Teach the duas in the same paired way to children and to anyone in the family who is learning them. Short sentences, learned at the actual door of the actual mosque, tend to stay for life; many adults still carry duas they were taught exactly that way. If a visit is rushed and the entry dua is only remembered once inside, the texts themselves fix no penalty or procedure — the duas are words taught for the door, and the habit is built by returning to them visit after visit until they arrive unbidden.

Finally, let the duas do their deeper work. A person who asks for mercy every time he enters will slowly start to feel what he is asking for; a person who asks for abundance every time he leaves will slowly start to see his working day as something carried by Allah’s grace rather than by his own strength alone. That is the quiet power of the small Sunnah duas — said in seconds, they reshape the way whole days are understood. Our guide to the dua before sleeping shows the same pattern at the other end of the day: the Sunnah has framed the believer’s day with supplication from its doors to its pillow.

Frequently Asked Questions

Q1. What is the dua for entering the mosque? The dua for entering the mosque is: Allahumma iftah li abwaba rahmatik — “O Allah, open to me the gates of thy mercy,” as taught in Sunan Abu Dawud 465 and Sahih Muslim 713a.

Q2. What should be said before the dua for entering the mosque? According to the narration of Abu Usaid al-Ansari in Sunan Abu Dawud 465, when a person enters the mosque he should first invoke blessing on the Prophet ﷺ, and then say the dua asking Allah to open the gates of His mercy.

Q3. What is the dua for leaving the mosque? The dua for leaving the mosque is: Allahumma inni as’aluka min fadlik — “O Allah, I ask thee out of Thine abundance” (Sunan Abu Dawud 465). In Sahih Muslim 713a the same request is rendered: “O Allah! I beg of Thee Thy Grace.”

Q4. Who narrated the duas for entering and leaving the mosque? Both duas were narrated by Abu Usaid. His report appears in Sunan Abu Dawud 465 and in Sahih Muslim 713a, and Sahih Muslim 713b records that a hadith like this was also narrated from the Messenger of Allah ﷺ by Abu Usaid.

Q5. Why do the mosques hold such a place in Islam? Because, as Allah says, “masājid (mosques) belong to Allah” (Quran 72:18), and they are the houses Allah “has permitted to be raised, and where His name is recounted and His purity is pronounced, in the morning and in the evening” (Quran 24:36).

Similar Posts

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Support Glory of Iman

This platform is free for everyone and community-supported, with no commercial sponsor. Your support keeps it online and growing.

Donate to Support Our Mission