Dua for Entering Masjid al-Haram and Masjid an-Nabawi, Makkah and Madinah

Dua for entering Masjid al-Haram and Masjid an-Nabawi, whether to begin with tawaf or prayer, the dua for leaving, and duas for Makkah and Madinah.

This is a complete guide to the duas for entering Masjid al-Haram and Masjid an-Nabawi, in order: the duas for entering and leaving the mosque, what to do as soon as you enter Masjid al-Haram and Masjid an-Nabawi, and the duas for entering the cities of Makkah and Madinah. Each dua is labelled by its source. May it help you, in sha Allah.

Editorial review: 24 October 2026 · English edition: 3 December 2026 · Expert fiqh review: in progress · Main references: Sahih Muslim, Sahih al-Bukhari, Sunan Abi Dawud and al-Majmu‘ by Imam al-Nawawi.

Short answer

The dua for entering Masjid al-Haram and Masjid an-Nabawi is the same as for any other mosque: step in with your right foot, send salawat on the Prophet ﷺ, then recite “Allāhummaftah lī abwāba rahmatik” (Sahih Muslim, no. 713).

In Masjid al-Haram, the greeting of the mosque for someone who intends to perform tawaf is the tawaf itself. In Masjid an-Nabawi, pray two rak‘ahs of tahiyyat al-masjid, then visit the grave and send salam upon the Messenger of Allah ﷺ.

Entering the mosque

Dua for Entering Masjid al-Haram and Masjid an-Nabawi

  1. Step in with your right foot first. Imam al-Bukhari made this the title of a separate chapter in the Book of Prayer.
  2. Send salawat upon the Prophet ﷺ (Sunan Abi Dawud, no. 465).
  3. Recite the dua for entering the mosque below. You may recite it quietly or in your heart, especially when the gate is crowded.

Dua for entering the mosqueSahih hadith

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

Allāhummaftah lī abwāba rahmatik.

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

Sahih Muslim, no. 713, from Abu Humaid or Abu Usaid (may Allah be pleased with them). In the narration of Abu Dawud (no. 465), it is preceded by salam upon the Prophet ﷺ.

Dua for protection when entering the mosqueSahih hadith

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

A‘ūdhu billāhil-‘aẓīm, wa biwajhihil-karīm, wa sultānihil-qadīm, minash-shaitānir-rajīm.

I seek refuge in Allah the Almighty, in His noble Face and His eternal authority, from Satan the outcast.

Sunan Abi Dawud, no. 466, from ‘Abdullah ibn ‘Amr (may Allah be pleased with him). Graded sahih by al-Albani.

Masjid al-Haram

As Soon as You Enter Masjid al-Haram: Tawaf or Prayer First?

The Shafi‘i scholars state that beginning with tawaf is sunnah for everyone who enters Masjid al-Haram, whether or not they are in ihram (al-Majmu‘, 8/11). For Umrah pilgrims, the tawaf of Umrah is what comes first.

Your situationWhat to do
You came to perform tawaf, including the tawaf of UmrahGo straight to tawaf. The two rak‘ahs of tawaf afterwards also earn the reward of tahiyyat al-masjid
You came to pray, not to perform tawafPray two rak‘ahs of tahiyyat al-masjid before sitting down
The iqamah has been called, or you fear missing the obligatory prayer in congregationPray the obligatory prayer with the imam first, then perform tawaf

Sources for this table: al-Majmu‘, 8/11, quoted by Dar al-Ifta’ of Egypt (fatwa no. 7699), I‘anat al-Talibin, 2/352, and Sahih al-Bukhari, no. 444 (tahiyyat al-masjid).

When the Kaaba comes into view, raise your hands and make dua. The duas commonly recited on seeing the Kaaba are in the guide Dua When Seeing the Kaaba.

Full guideDua When Seeing the KaabaDuas on seeing the Kaaba, at the Multazam and in the Hijr Isma‘il

Next stepTawaf for Umrah and HajjThe niyyah, the method and what to recite in each circuit

Masjid an-Nabawi

As Soon as You Enter Masjid an-Nabawi

  1. Recite the dua for entering the mosque as above.
  2. Pray tahiyyat al-masjid. Two rak‘ahs before sitting down (Sahih al-Bukhari, no. 444).
  3. Go to the grave of the Messenger of Allah ﷺ to send salam upon him, then upon Abu Bakr and ‘Umar (may Allah be pleased with them).
  4. If you already have a Nusuk permit, enter the Rawdah according to your assigned slot.

There is no ihram and there are no prohibitions of ihram in Madinah. The etiquette of visiting the mosque and the grave is still observed.

Leaving the mosque

Dua for Leaving the Mosque

When leaving, step out with your left foot first, send salawat, then recite:

Dua for leaving the mosqueSahih hadith

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

Allāhumma innī as’aluka min fadhlik.

O Allah, I ask You of Your bounty.

Sahih Muslim, no. 713.

The holy cities

Duas for Entering Makkah and Madinah

Entering Makkah

There is no authentic specific wording of dua from the Prophet ﷺ for entering the city of Makkah. Umrah and Hajj pilgrims are still in ihram, so the most important practice is to continue the talbiyah until you begin tawaf. It is also sunnah to take a bath before entering Makkah, as Ibn ‘Umar (may Allah be pleased with him) did and attributed to the Prophet ﷺ (Sahih al-Bukhari, no. 1573).

If you wish to recite a dua, the dua of the Prophet Ibrahim (peace be upon him) for Makkah in the Quran is very fitting:

The dua of the Prophet Ibrahim for MakkahQuran

رَبِّ اجْعَلْ هٰذَا الْبَلَدَ آمِنًا وَاجْنُبْنِيْ وَبَنِيَّ أَنْ نَعْبُدَ الْأَصْنَامَ

Rabbij‘al hādhal-balada āminan wajnubnī wa baniyya an na‘budal-asnām.

My Lord, make this city (Makkah) secure, and keep me and my children away from worshipping idols.

Surah Ibrahim, verse 35.

There is also a dua for entering Makkah that is widespread in manasik books, beginning with “Allāhumma inna hādhal-balada baladuk”. It is not the wording of a hadith, and al-Mawardi mentions it without a chain. Its meaning is good, so it may be recited as a general dua, without regarding it as a specific dua from the Prophet ﷺ. The full version in the Tabung Haji (Malaysia) prayer book can be opened below.

Tabung Haji guide version

This dua follows the Tabung Haji (Malaysia) prayer book, recited when the buildings of Makkah first come into view. It is a general dua with a good meaning.

Dua on first seeing the city of MakkahArranged by scholars

اللَّهُمَّ اجْعَلْ لِي بِهَا قَرَارًا، وَارْزُقْنِي فِيهَا رِزْقًا حَلَالًا. اللَّهُمَّ إِنَّ هَذَا الْحَرَمَ حَرَمُكَ، وَالْبَلَدَ بَلَدُكَ، وَالْأَمْنَ أَمْنُكَ، وَالْعَبْدَ عَبْدُكَ، جِئْتُكَ مِنْ بِلَادٍ بَعِيدٍ، بِذُنُوبٍ كَثِيرَةٍ وَأَعْمَالٍ سَيِّئَةٍ، أَسْأَلُكَ مَسْأَلَةَ الْمُضْطَرِّينَ إِلَيْكَ، الْمُشْفِقِينَ مِنْ عَذَابِكَ، أَنْ تَسْتَقْبِلَنِي بِمَحْضِ عَفْوِكَ، وَأَنْ تُدْخِلَنِي فِي فَسِيحِ جَنَّتِكَ جَنَّةِ النَّعِيمِ. اللَّهُمَّ إِنَّ هَذَا حَرَمُكَ، فَحَرِّمْ لَحْمِي وَدَمِي وَعَظْمِي عَلَى النَّارِ.

Allāhummaj‘al lī bihā qarārā, warzuqnī fīhā rizqan halālā. Allāhumma inna hādhal-harama haramuk, wal-balada baladuk, wal-amna amnuk, wal-‘abda ‘abduk, ji’tuka min bilādin ba‘īd, bidhunūbin kathīratin wa a‘mālin sayyi’ah, as’aluka mas’alatal-mudhtarrīna ilaik, al-mushfiqīna min ‘adhābik, an tastaqbilanī bimahdhi ‘afwik, wa an tudkhilanī fī fasīhi jannatika jannatin-na‘īm. Allāhumma inna hādhā haramuk, faharrim lahmī wa damī wa ‘aẓmī ‘alan-nār.

Meaning and source

O Allah, make this city a place of tranquil dwelling for me, and grant me lawful provision in it. O Allah, this sanctuary is Your sanctuary, this city is Your city, this safety is from You, and this servant is Your servant. I have come to You from a distant land, bearing many sins and evil deeds. I ask You as one in great need of You and fearful of Your punishment asks, that You receive me with nothing but Your pardon, and admit me into Your vast Paradise, the Garden of Bliss. O Allah, this is Your sanctuary, so forbid my flesh, my blood and my bones to the Fire.

A dua arranged by scholars, not a hadith of the Prophet ﷺ. The Arabic follows Himpunan Doa-Doa Terpilih di Tanah Suci, Lembaga Tabung Haji (2018). The transliteration and meaning are by AkuIslam.

Entering Madinah

Likewise, there is no specific wording for entering Madinah. Send abundant salawat. Among the authentic duas of the Prophet ﷺ for Madinah is:

Dua for blessing upon MadinahSahih hadith

اللّٰهُمَّ اجْعَلْ بِالْمَدِيْنَةِ ضِعْفَيْ مَا جَعَلْتَ بِمَكَّةَ مِنَ الْبَرَكَةِ

Allāhummaj‘al bil-Madīnati dhi‘faī mā ja‘alta bi Makkata minal-barakah.

O Allah, place in Madinah twice the blessing You have placed in Makkah.

Sahih al-Bukhari, no. 1885, from Anas (may Allah be pleased with him).

Full guideTalbiyahThe wording, meaning and when to start and stop

Q&A

Frequently Asked Questions

Is the dua for entering Masjid al-Haram different from other mosques?

No. The authentic dua for entering a mosque is the same for every mosque. What differs is what you do after entering: in Masjid al-Haram, tawaf is the greeting of the mosque for someone who intends to perform it.

Should I recite the dua every time I enter Masjid al-Haram?

Yes. It is sunnah to recite it every time you enter the mosque, including if you leave and re-enter on the same day.

Can the dua for entering the mosque be recited in the heart?

Yes, especially when the gate is crowded or you are in a group. What matters is that you are mindful of its meaning.

I entered Masjid al-Haram during the iqamah. Should I perform tawaf first?

No. Pray the obligatory prayer with the imam first, then perform tawaf.

Do I need to pray tahiyyat al-masjid if I go straight to tawaf?

There is no need to pray tahiyyat al-masjid separately. The two rak‘ahs of tawaf after tawaf already earn its reward, as long as you do not deliberately sit for a long time before that prayer.

Sources

References

  1. Sahih Muslim, no. 713 (the duas for entering and leaving the mosque). sunnah.com
  2. Sunan Abi Dawud, no. 465 and 466 (salam upon the Prophet ﷺ and the dua for protection when entering the mosque). sunnah.com
  3. Sahih al-Bukhari, no. 444 (tahiyyat al-masjid), no. 1573 (bathing before entering Makkah) and no. 1885 (the dua for blessing upon Madinah). sunnah.com
  4. The Quran, Surah Ibrahim, verse 35. quran.com
  5. Al-Nawawi, al-Majmu‘, 8/11 (beginning with tawaf), quoted by Dar al-Ifta’ of Egypt, fatwa no. 7699 (13 June 2023, in Arabic). dar-alifta.org
  6. Al-Bakri al-Dimyati, I‘anat al-Talibin, 2/352 (tahiyyat al-masjid is attained through the two rak‘ahs of tawaf). al-Maktabah al-Shamilah
  7. IslamQA, answer no. 106955: the status of the widespread dua for entering Makkah (al-Mawardi, Ibn Hajar, in Arabic). islamqa.info

Written by

Muhamad Naim Abd Manaf

Founder of AkuIslam. Writing worship guides since 2010 in plain language, with references that are checked.

اِقْرَأْ أَيْضًا

Related Reading

Chosen based on this article

Share your thoughts or questions

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