Contents 13 sections
- What Is the Dua for Entering the Mosque?
- The Narrations of the Dua for Entering the Mosque
- The Dua for Leaving the Mosque
- Why is “mercy” asked for on entering and “bounty” on leaving?
- Tahiyyat al-Masjid: The Prayer Performed on Entering the Mosque
- When is tahiyyat al-masjid not performed?
- Entering Masjid al-Haram: Dua, Tawaf and Tahiyyah
- Entering the Prophet’s Mosque
- The Etiquette of Entering the Mosque: Ablution, Dress and Scent
- Things to Observe in the Mosque and on Leaving
- The Duas for Entering and Leaving the Mosque: Summary Table
- Can the Dua Be Recited in English?
- Frequently Asked Questions
The dua for entering the mosque is a short supplication which the Prophet is reported to have recited on every entry into the mosque: “O Allah, open for me the gates of Your mercy.” On leaving the mosque one says, “O Allah, I ask You of Your bounty.” These two sentences remind us that entering the mosque is the beginning of an act of worship and leaving it is a return to the world. In this article we give the Arabic words and the meaning of the duas for entering and leaving the mosque together with their hadith sources, and explain in turn entering with the right foot, the basmala and the salawat, the tahiyyat al-masjid prayer, the disliked times, the differences when entering Masjid al-Haram and the Prophet’s Mosque, and the etiquette of the mosque. Since these duas will be recited five times a day at the gates of the Haram on the Umrah and Hajj journey, short texts that are easy to memorise have been chosen.
In Short
“Bismillâhi ve’s-salâtü ve’s-selâmü alâ Rasûlillâh. Allâhümme’ftah lî ebvâbe rahmetik” (In the name of Allah; blessings and peace be upon the Messenger of Allah. O Allah, open for me the gates of Your mercy). One enters with the right foot and prays two rak’ahs of tahiyyat al-masjid before sitting.
What Is the Dua for Entering the Mosque?
The origin of the dua recited on entering the mosque is the following hadith, narrated from Abu Humayd or Abu Usayd (may Allah be pleased with them): “When one of you enters the mosque, let him say ‘Allâhümme’ftah lî ebvâbe rahmetik’; and when he leaves, let him say ‘Allâhümme innî es’elüke min fadlik'” (Muslim, Musafirin 68; Abu Dawud, Salat 18). Saying the basmala before the dua and sending blessings and peace upon the Prophet also appear in other narrations on the same subject. It is not a condition that the dua be recited at a particular gate or in a particular tone of voice; saying it on the threshold, inwardly or quietly is enough. Entering the mosque with the right foot and beginning with the left foot on leaving is also Sunnah; the words “It is of the Sunnah that you begin with your right foot when entering the mosque and with your left foot when leaving” are narrated from Anas ibn Malik (may Allah be pleased with him) (al-Hakim, al-Mustadrak). Thus entering the mosque is completed in four steps: the right foot, the basmala and the salawat, the dua of mercy, and then the tahiyyat al-masjid prayer. The whole of this routine takes less than a minute; but it is this one minute that makes the difference between “having entered” the mosque and entering it with proper manners. Since the gates of Masjid al-Haram and the Prophet’s Mosque will be passed through five times a day on Umrah and Hajj, the dua should be memorised before the journey.
Words: Bismillâhi ve’s-salâtü ve’s-selâmü alâ Rasûlillâh. Allâhümme’ftah lî ebvâbe rahmetik. (Bismillahi wa’s-salatu wa’s-salamu ala Rasulillah. Allahumma’ftah li abwaba rahmatik.)
Meaning: In the name of Allah; blessings and peace be upon the Messenger of Allah. O Allah, open for me the gates of Your mercy.
The Narrations of the Dua for Entering the Mosque
The sources contain several narrations of the dua recited on entering the mosque, and all of them may be recited together. In the narration reported by Abu Dawud, the Prophet would first seek refuge in Allah from Satan when entering the mosque: “Eûzü billâhi’l-azîm ve bi-vechihi’l-kerîm ve sultânihi’l-kadîm mine’ş-şeytâni’r-racîm” (I seek refuge in Allah the Almighty, in His Noble Countenance and in His eternal sovereignty from the accursed Satan). The hadith relates that for the person who recites this dua, Satan says, “This person is protected from me for the rest of the day” (Abu Dawud, Salat 18). In the narration that comes from Fatimah (may Allah be pleased with her), the Prophet would say on entering the mosque, “Bismillâh, ve’s-selâmü alâ Rasûlillâh. Allâhümme’ğfir lî zünûbî ve’ftah lî ebvâbe rahmetik” (In the name of Allah; peace be upon the Messenger of Allah. O Allah, forgive me my sins and open for me the gates of Your mercy); on leaving he would repeat the same sentence with the word “fadl” (bounty) in place of “mercy” (Tirmidhi, Salat 117; Ibn Majah, Masajid 13). In the dua books of the Presidency of Religious Affairs (Diyanet) these narrations are combined and the basmala, the salawat, the prayer for forgiveness and the dua of mercy are given one after another; whichever you recite, entering the mosque in hope of Allah’s mercy is the essence of the dua. The small differences of wording between the narrations reflect the forms the Companions heard from the Prophet at different times; since all of them appear in sound sources, the Sunnah is followed whichever is recited. To make memorising easier, it is enough to begin with the short one (the dua of mercy) and then add the sentences of seeking refuge and of forgiveness.
The Dua for Leaving the Mosque
The dua recited on leaving the mosque is the counterpart of the dua at the entrance: “Allâhümme innî es’elüke min fadlik” (O Allah, I ask You of Your bounty) (Muslim, Musafirin 68). In the narration that comes from Abu Hurayrah (may Allah be pleased with him), the sentence “Allâhümme’sımnî mine’ş-şeytâni’r-racîm” (O Allah, protect me from the accursed Satan) is added on leaving (Ibn Majah, Masajid 13). One leaves the mosque with the left foot, and the basmala and the salawat are said again. This order means that the person leaving the mosque, before plunging straight into worldly business, asks for Allah’s bounty, that is, lawful provision and protection; the same word is used in the verse of Surah al-Jumu’ah, “When the prayer has been performed, disperse in the land and seek of Allah’s bounty” (al-Jumu’ah, 62/10).
Words: Bismillâhi ve’s-salâtü ve’s-selâmü alâ Rasûlillâh. Allâhümme innî es’elüke min fadlik. Allâhümme’sımnî mine’ş-şeytâni’r-racîm. (Bismillahi wa’s-salatu wa’s-salamu ala Rasulillah. Allahumma inni as’aluka min fadlik. Allahumma’simni mina’sh-shaytani’r-rajim.)
Meaning: In the name of Allah; blessings and peace be upon the Messenger of Allah. O Allah, I ask You of Your bounty. O Allah, protect me from the accursed Satan.
Why is “mercy” asked for on entering and “bounty” on leaving?
The scholars explain the difference like this: the person entering the mosque has come to draw near to Allah through prayer, remembrance and the Quran, and therefore asks for the gates of mercy to be opened. The person leaving the mosque is returning to the world to seek their provision; since lawful earning is called “the bounty of Allah” (fadl) in the Quran, bounty is asked for on leaving. In this way the Muslim sees worship and work as the two halves of a single dua.

Tahiyyat al-Masjid: The Prayer Performed on Entering the Mosque
The prayer people search for as “the prayer performed on entering the mosque” is called tahiyyat al-masjid, the prayer of “greeting the mosque”. In the hadith narrated from Abu Qatadah (may Allah be pleased with him), the Prophet said, “When one of you enters the mosque, let him not sit down until he has prayed two rak’ahs” (Bukhari, Salat 60; Muslim, Musafirin 69). This prayer is two rak’ahs; according to the Hanafi school it is Sunnah, and it is performed as soon as one enters the mosque, before sitting down. If the Sunnah or the obligatory prayer of the time is performed, tahiyyat al-masjid is not performed separately, because the first prayer performed on entering the mosque takes its place. If the congregation has stood for the obligatory prayer, joining the congregation takes priority over the tahiyyah. On Friday, while the sermon is being delivered, tahiyyat al-masjid is not performed according to the Hanafis; one sits and listens to the sermon; the Shafi’is consider it appropriate to perform it on condition that it is kept short. The intention is made inwardly, in the form “to perform the tahiyyat al-masjid prayer”; there is no restriction on the surahs to be recited. If the congregation has stood for the obligatory prayer, joining it takes priority; if the adhan is being called, one first listens to the adhan and responds to it, then stands for prayer. For someone who enters and leaves the mosque several times, it is not necessary to perform the tahiyyah at every entry; the Hanafi scholars have considered performing it once a day sufficient.
When is tahiyyat al-masjid not performed?
Tahiyyat al-masjid is not performed at the three times when voluntary prayer is disliked: after the dawn prayer until sunrise, when the sun is at its zenith (the time of zawal) and after the afternoon prayer until sunset. A person entering the mosque at these times may greet the mosque with a short remembrance or salawat before sitting down. The ruling is the same for women; a woman entering the mosque prays two rak’ahs before sitting down.
Entering Masjid al-Haram: Dua, Tawaf and Tahiyyah
The same dua is recited when entering Masjid al-Haram; but there are two differences. First, the person who enters Masjid al-Haram and sees the Kaaba for the first time stops there and makes supplication; the dua and etiquette of that moment are explained in our article on the dua to recite on seeing the Kaaba. Second, the tahiyyah of Masjid al-Haram is tawaf: a person who will perform tawaf for Umrah or Hajj does not perform the tahiyyat al-masjid prayer but begins tawaf directly, and after the tawaf performs the two rak’ahs of the tawaf prayer behind the Station of Ibrahim. If they will not perform tawaf, for example if they have entered the mosque only for the prayer of the time, they perform two rak’ahs of tahiyyat al-masjid. Entering Masjid al-Haram through Bab as-Salam has been considered in keeping with the Sunnah, but today it makes no difference which of the mosque’s more than a hundred gates one enters by. Our articles on how tawaf is performed and the sections of Masjid al-Haram give the details of these steps; for the other duas recited throughout Umrah, see our article on duas to recite during Umrah.
Entering the Prophet’s Mosque
The dua for entering the mosque is recited on entering the Prophet’s Mosque in Madinah as well; since one is entering the mosque of the Prophet, the part with blessings and peace is said with particular sincerity. Visitors traditionally enter through Bab as-Salam, perform two rak’ahs of tahiyyat al-masjid in the Rawdah if possible, otherwise anywhere in the mosque, then stand respectfully before the Prophet’s grave and give greetings, and give greetings to Abu Bakr and Umar. Since a permit system is applied for praying in the Rawdah, this step is taken according to the appointment time obtained in advance; the dua and etiquette of the visit are explained in our articles on the dua for visiting the Rawdah and the Prophet’s Mosque. The same dua of entry is recited at the Quba Mosque visited in Madinah; the Prophet is reported to have said, “Whoever performs ablution at home and goes to the Quba Mosque and prays there receives the reward of an Umrah” (Tirmidhi, Salat 125; Ibn Majah, Iqamah 197); our article on the Quba Mosque gives the details of that visit.
The Etiquette of Entering the Mosque: Ablution, Dress and Scent
The Quran says, “O children of Adam, take your adornment at every mosque” (al-A’raf, 7/31); this verse commands going to the mosque in clean and proper dress. Entering the mosque without ablution is permissible, but since ablution will be needed for prayer, entering with ablution and ready is preferred; those in a state of major ritual impurity, menstruation or post-natal bleeding are not considered right to stay in the mosque unless there is a necessity. The Prophet asked that a person who has eaten onions or garlic not come near the mosque until the smell has passed (Bukhari, Adhan 160; Muslim, Masajid 73); this ruling is taken to apply to every smell that disturbs the congregation, such as cigarette and sweat odours. On Friday, taking a full bath, applying a pleasant scent and going to the mosque early are Sunnah. In brief, what to do on entering the mosque is as follows:
- Take off your shoes at the door and put them on the shelves or in a bag; do not block anyone’s way.
- Enter with the right foot; recite the basmala, the salawat and the dua of mercy.
- Put your phone on silent; switch off sound and vibration before entering the mosque.
- Before sitting, pray two rak’ahs of tahiyyat al-masjid (unless it is a disliked time).
- Do not pass in front of the rows; rather than crossing in front of someone praying, go round to find a place.
Things to Observe in the Mosque and on Leaving
Speaking loudly in the mosque, talking about trade or worldly business, announcing lost property and disturbing those praying are not looked upon well; the Prophet said that a person searching for lost property in the mosque should be told, “May Allah not return it to you” (Muslim, Masajid 79). One keeps quiet beside a person reciting the Quran, making remembrance or praying, does not break the order of the rows and does not leave the front rows empty. Getting children used to the mosque is good; but they are not allowed to run and shout, and small children are seated beside their parents. One leaves with the left foot, recites the dua of bounty and, if possible, leaves something in the charity box. On Umrah and Hajj, remembering the gate number and the hotel you are staying in when leaving the mosque is a practical piece of etiquette so as not to get lost in the crowds. A list summarising the etiquette of entering and leaving the mosque:
- Right foot on entering, left foot on leaving; the basmala and the salawat in both.
- The dua of mercy on entering; the dua of bounty and protection from Satan on leaving.
- Tahiyyat al-masjid before sitting; in Masjid al-Haram, tawaf takes its place.
- Clean dress, pleasant scent, silent phone; not coming with the smell of onion and garlic.
- Not passing in front of someone praying, keeping the rows straight, not talking loudly in the mosque.

The Duas for Entering and Leaving the Mosque: Summary Table
| Situation | Words | Meaning | Source |
|---|---|---|---|
| On entering (seeking refuge) | Eûzü billâhi’l-azîm ve bi-vechihi’l-kerîm ve sultânihi’l-kadîm mine’ş-şeytâni’r-racîm | I seek refuge in Allah the Almighty, in His Noble Countenance and in His eternal sovereignty from the accursed Satan | Abu Dawud, Salat 18 |
| On entering (dua of mercy) | Bismillâhi ve’s-salâtü ve’s-selâmü alâ Rasûlillâh. Allâhümme’ftah lî ebvâbe rahmetik | In the name of Allah; blessings and peace be upon the Messenger of Allah. O Allah, open for me the gates of Your mercy | Muslim, Musafirin 68; Tirmidhi, Salat 117 |
| On entering (with forgiveness) | Allâhümme’ğfir lî zünûbî ve’ftah lî ebvâbe rahmetik | O Allah, forgive me my sins and open for me the gates of Your mercy | Tirmidhi, Salat 117; Ibn Majah, Masajid 13 |
| On leaving (dua of bounty) | Allâhümme innî es’elüke min fadlik | O Allah, I ask You of Your bounty | Muslim, Musafirin 68 |
| On leaving (dua of protection) | Allâhümme’sımnî mine’ş-şeytâni’r-racîm | O Allah, protect me from the accursed Satan | Ibn Majah, Masajid 13 |
| Prayer on entering | Tahiyyat al-masjid, two rak’ahs | The prayer of greeting the mosque; in Masjid al-Haram, tawaf takes its place | Bukhari, Salat 60; Muslim, Musafirin 69 |
Can the Dua Be Recited in English?
Yes. Since the duas recited on entering and leaving the mosque are not part of the ritual prayer, they may be recited in English or Turkish; what matters is to say them knowing what is being asked. Memorising the Arabic text is good as a way of keeping to the wording of the Prophet, and reciting it in Arabic at the gates of the Haram on Umrah is easy; but rather than reciting from memory without knowing the meaning, saying “O Allah, open for me the gates of Your mercy” is more heartfelt. The Latin-letter transliterations in dua books are an approximate equivalent of the Arabic pronunciation; the transliterations in this article are also given in the spelling commonly used by Diyanet. For the other duas used throughout the Umrah journey see our articles on Hajj duas and the travel dua, and for programmes our Umrah tours page.
Frequently Asked Questions
Which dua is recited on entering the mosque?
“Bismillâhi ve’s-salâtü ve’s-selâmü alâ Rasûlillâh. Allâhümme’ftah lî ebvâbe rahmetik” (In the name of Allah; blessings and peace be upon the Messenger of Allah. O Allah, open for me the gates of Your mercy). One enters with the right foot and prays two rak’ahs of tahiyyat al-masjid before sitting.
Which dua is recited on leaving the mosque?
“Allâhümme innî es’elüke min fadlik” (O Allah, I ask You of Your bounty). One leaves with the left foot; according to the narration in Ibn Majah, “Allâhümme’sımnî mine’ş-şeytâni’r-racîm” (O Allah, protect me from the accursed Satan) is added as well.
How many rak’ahs is tahiyyat al-masjid and when is it performed?
It is two rak’ahs and is performed on entering the mosque, before sitting down. The Sunnah or obligatory prayer of the time takes its place; according to the Hanafis it is not performed at the disliked times or during the Friday sermon.
Is tahiyyat al-masjid performed on entering Masjid al-Haram?
A person who will perform tawaf does not perform it; the tahiyyah of Masjid al-Haram is tawaf, and after the tawaf two rak’ahs of the tawaf prayer are performed. If they will not perform tawaf, they pray two rak’ahs of tahiyyat al-masjid.
Can one enter the mosque without ablution?
Entering without ablution is permissible; since ablution will be needed for prayer, entering with ablution is preferred. Those in a state of major ritual impurity, menstruation or post-natal bleeding are not considered right to stay in the mosque unless there is a necessity.
Do women recite the same dua on entering the mosque?
Yes; the duas of entering and leaving and the tahiyyat al-masjid are the same for women and men. Women enter through the section allocated to them, recite the same dua and pray two rak’ahs before sitting.
Questions answered in this article
What Is the Dua for Entering the Mosque?
The origin of the dua recited on entering the mosque is the following hadith, narrated from Abu Humayd or Abu Usayd (may Allah be pleased with them): “When one of you enters the mosque, let him say ‘Allâhümme’ftah lî ebvâbe rahmetik’; and when he leaves, let him say ‘Allâhümme innî es’elüke min fadlik'” (Muslim, Musafirin 68; Abu Dawud, Salat 18). Saying the basmala before the dua and sending blessings and peace upon the Prophet also appear in other narrations on the same subject. It is not a condition that the dua be recited at a particular gate or in a particular tone of voice; saying it on the threshold, inwardly or quietly is enough. Entering the mosque with the right foot and beginning with the left foot on leaving is also Sunnah; the words “It is of the Sunnah that you begin with your right foot when entering the mosque and with your left foot when leaving” are narrated from Anas ibn Malik (may Allah be pleased with him) (al-Hakim, al-Mustadrak). Thus entering the mosque is completed in four steps: the right foot, the basmala and the salawat, the dua of mercy, and then the tahiyyat al-masjid prayer. The whole of this routine takes less than a minute; but it is this one minute that makes the difference between “having entered” the mosque and entering it with proper manners. Since the gates of Masjid al-Haram and the Prophet’s Mosque will be passed through five times a day on Umrah and Hajj, the dua should be memorised before the journey.
Why is “mercy” asked for on entering and “bounty” on leaving?
The scholars explain the difference like this: the person entering the mosque has come to draw near to Allah through prayer, remembrance and the Quran, and therefore asks for the gates of mercy to be opened. The person leaving the mosque is returning to the world to seek their provision; since lawful earning is called “the bounty of Allah” (fadl) in the Quran, bounty is asked for on leaving. In this way the Muslim sees worship and work as the two halves of a single dua.
When is tahiyyat al-masjid not performed?
Tahiyyat al-masjid is not performed at the three times when voluntary prayer is disliked: after the dawn prayer until sunrise, when the sun is at its zenith (the time of zawal) and after the afternoon prayer until sunset. A person entering the mosque at these times may greet the mosque with a short remembrance or salawat before sitting down. The ruling is the same for women; a woman entering the mosque prays two rak’ahs before sitting down.
Can the Dua Be Recited in English?
Yes. Since the duas recited on entering and leaving the mosque are not part of the ritual prayer, they may be recited in English or Turkish; what matters is to say them knowing what is being asked. Memorising the Arabic text is good as a way of keeping to the wording of the Prophet, and reciting it in Arabic at the gates of the Haram on Umrah is easy; but rather than reciting from memory without knowing the meaning, saying “O Allah, open for me the gates of Your mercy” is more heartfelt. The Latin-letter transliterations in dua books are an approximate equivalent of the Arabic pronunciation; the transliterations in this article are also given in the spelling commonly used by Diyanet. For the other duas used throughout the Umrah journey see our articles on Hajj duas and the travel dua, and for programmes our Umrah tours page.


















