Tahiyyatul Masjid: Two Rak‘ahs When You Enter the Mosque
Contents
You walk into the masjid early and sit down to wait. The Prophet ﷺ taught a small habit for that moment: tahiyyatul masjid, the “greeting of the mosque”, two rak‘ahs before you sit. Here are five authentic hadith on it, from the Friday khutbah to the return from a journey.
At a glance
- Hadith: 5 authentic hadith
- Collections: Sahih al-Bukhari, Sahih Muslim
- Grade: Sahih (Bukhari, Muslim)
- Topic: The two rak‘ahs on entering the mosque, and the prayer after wudu
- Do it today: Next time you enter a masjid, pray two rak‘ahs before you sit
1. Two rak‘ahs before you sit
Abu Qatadah as-Salami (may Allah be pleased with him) reported that the Prophet ﷺ said:
إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ فَلْيَرْكَعْ رَكْعَتَيْنِ قَبْلَ أَنْ يَجْلِسَ
“When one of you enters the mosque, let him pray two rak‘ahs before he sits.”
Sahih al-Bukhari 444 · Narrated by Abu Qatadah · Translation adapted from Sunnah.com
Muslim records it too (Sahih Muslim 714a). HadeethEnc’s explanation calls these two rak‘ahs the greeting of the mosque and says they are recommended whenever you enter and mean to sit. If you arrive as the congregational prayer is being prayed and join it, that takes their place.
Try this: Make it your first act in any masjid: shoes off, two rak‘ahs, then sit.
2. When Abu Qatadah sat down first
Abu Qatadah himself once forgot, and the Prophet ﷺ noticed:
دَخَلْتُ الْمَسْجِدَ وَرَسُولُ اللَّهِ صلى الله عليه وسلم جَالِسٌ بَيْنَ ظَهْرَانَىِ النَّاسِ - قَالَ - فَجَلَسْتُ فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم مَا مَنَعَكَ أَنْ تَرْكَعَ رَكْعَتَيْنِ قَبْلَ أَنْ تَجْلِسَ. قَالَ فَقُلْتُ يَا رَسُولَ اللَّهِ رَأَيْتُكَ جَالِسًا وَالنَّاسُ جُلُوسٌ. قَالَ فَإِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ فَلاَ يَجْلِسْ حَتَّى يَرْكَعَ رَكْعَتَيْنِ
“I entered the mosque while the Messenger of Allah ﷺ was sitting among the people, and I sat down. The Messenger of Allah ﷺ said: ‘What stopped you from praying two rak‘ahs before you sat?’ I said: ‘O Messenger of Allah, I saw you sitting and the people sitting.’ He said: ‘When one of you enters the mosque, let him not sit until he has prayed two rak‘ahs.’”
Sahih Muslim 714b · Narrated by Abu Qatadah · Translation adapted from Sunnah.com
Even with the Prophet ﷺ and the people already seated, the instruction stayed the same.
Try this: If friends are already sitting when you arrive, greet them after your two rak‘ahs.
3. Tahiyyatul masjid during the khutbah
Jabir ibn ‘Abdullah (may Allah be pleased with him) reported what happened one Friday:
دَخَلَ رَجُلٌ الْمَسْجِدَ وَرَسُولُ اللَّهِ صلى الله عليه وسلم يَخْطُبُ يَوْمَ الْجُمُعَةِ فَقَالَ أَصَلَّيْتَ. قَالَ لاَ. قَالَ قُمْ فَصَلِّ الرَّكْعَتَيْنِ
“A man entered the mosque while the Messenger of Allah ﷺ was giving the khutbah on Friday. He asked: ‘Have you prayed?’ He said: ‘No.’ He said: ‘Stand up and pray the two rak‘ahs.’”
Sahih Muslim 875c · Narrated by Jabir ibn ‘Abdullah · Translation adapted from Sunnah.com
Al-Bukhari reports the same event (Sahih al-Bukhari 930). Scholars differ on praying during the khutbah; see the section on where scholars differ below.
Try this: Come to Jummah early, so you can pray your two rak‘ahs before the khutbah begins.
4. The first stop after a journey
Ka‘b ibn Malik (may Allah be pleased with him) described how the Prophet ﷺ came home from his travels:
كَانَ لاَ يَقْدَمُ مِنْ سَفَرٍ إِلاَّ نَهَارًا فِي الضُّحَى فَإِذَا قَدِمَ بَدَأَ بِالْمَسْجِدِ فَصَلَّى فِيهِ رَكْعَتَيْنِ ثُمَّ جَلَسَ فِيهِ
“The Messenger of Allah ﷺ would only return from a journey by day, in the forenoon. When he arrived, he went to the mosque first, prayed two rak‘ahs in it, and then sat in it.”
Sahih Muslim 716 · Narrated by Ka‘b ibn Malik · Translation adapted from Sunnah.com
Jabir (may Allah be pleased with him) also reported that when he came to the Prophet ﷺ in the mosque, he was told to pray two rak‘ahs first; the Prophet ﷺ then repaid a debt he owed him, and gave him more (Sahih al-Bukhari 443).
Try this: Back from a trip? If a masjid is on your way home, stop and pray two rak‘ahs there.
5. The prayer after wudu
A related voluntary prayer comes from Bilal (may Allah be pleased with him). Abu Hurayrah (may Allah be pleased with him) reported that at the time of Fajr the Prophet ﷺ said to him:
يَا بِلاَلُ حَدِّثْنِي بِأَرْجَى عَمَلٍ عَمِلْتَهُ فِي الإِسْلاَمِ، فَإِنِّي سَمِعْتُ دَفَّ نَعْلَيْكَ بَيْنَ يَدَىَّ فِي الْجَنَّةِ. قَالَ مَا عَمِلْتُ عَمَلاً أَرْجَى عِنْدِي أَنِّي لَمْ أَتَطَهَّرْ طُهُورًا فِي سَاعَةِ لَيْلٍ أَوْ نَهَارٍ إِلاَّ صَلَّيْتُ بِذَلِكَ الطُّهُورِ مَا كُتِبَ لِي أَنْ أُصَلِّيَ
“O Bilal, tell me of the most hopeful deed you have done in Islam, for I heard the sound of your footsteps ahead of me in Paradise.” He said: “I have done no deed more hopeful to me than this: whenever I purified myself, at any hour of the night or day, I prayed with that purification whatever was written for me to pray.”
Sahih al-Bukhari 1149 · Narrated by Abu Hurayrah · Translation adapted from Sunnah.com
Bilal did not name a number of rak‘ahs: he prayed “whatever was written” for him after each wudu. More on wudu itself in how to make wudu.
Try this: After your next wudu, pray two rak‘ahs before you do anything else.
Where scholars differ on tahiyyatul masjid
- The forbidden times: the Prophet ﷺ forbade prayer at sunrise, at midday and at sunset (Sahih Muslim 831). Scholars differ on whether a prayer with a reason, like tahiyyatul masjid, may be prayed after Asr or just before Maghrib.
- During the khutbah: some scholars hold that you sit and listen; others take the hadith of the man told to pray (hadith 3).
- When the iqamah is called: “When the prayer begins, there is no prayer except the obligatory one” (Sahih Muslim 710a), so join the congregation; HadeethEnc notes this takes the place of the two rak‘ahs.
- Passing through: HadeethEnc notes that someone who enters and leaves without sitting is not included in the instruction.
We don’t give rulings on this site. For your own practice, ask a qualified scholar or your local religious authority.
Bringing it together
Reflection: A masjid is Allah’s house, and these hadith teach us to greet it the way we would greet a host: before we sit down, before we chat, before we wait. Two short rak‘ahs turn waiting time into worship.
Questions people ask
Is tahiyyatul masjid obligatory?
HadeethEnc’s explanation of Bukhari 444 describes it as recommended. For your own madhhab’s view, ask a qualified local scholar.
Can I pray tahiyyatul masjid after Asr or before Maghrib?
Scholars differ. The Prophet ﷺ forbade prayer at sunrise, midday and sunset (Muslim 831), and scholars differ on whether a prayer with a reason, like the greeting of the mosque, may be prayed at those times. Ask a qualified scholar.
Should I pray tahiyyatul masjid during the khutbah?
The Prophet ﷺ told a man who sat down during the Friday khutbah to stand and pray two rak‘ahs (Muslim 875c, Bukhari 930). Scholars differ on applying this, so ask a qualified scholar.
What if the iqamah has already started?
Join the congregation: “When the prayer begins, there is no prayer except the obligatory one” (Muslim 710a). HadeethEnc notes that joining the prayer takes the place of the two rak‘ahs.
Is there a prayer after wudu?
Bilal prayed “whatever was written” for him after every wudu, and the Prophet ﷺ heard his footsteps in Paradise (Bukhari 1149). The hadith names no fixed number of rak‘ahs.
Key lessons

- Pray two rak‘ahs when you enter the mosque, before you sit (Bukhari 444).
- The instruction held even when everyone was already seated (Muslim 714b).
- The Prophet ﷺ told a man to pray them during the Friday khutbah (Muslim 875c).
- His first stop after a journey was the mosque and two rak‘ahs (Muslim 716).
- Bilal prayed after every wudu, and his footsteps were heard in Paradise (Bukhari 1149).
Part of our Salah series: see all our salah articles in one place.
May Allah make the masjid a place we greet with prayer, and keep our hearts attached to it.
Save this to Pinterest so you remember the two rak‘ahs next time you walk into a masjid

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.






