Question: Is it necessary to pray Tahiyyat al-Masjid (the greeting of the mosque), and can these rak’ahs also be performed during the prohibited times?
Answer: In our view, the most correct position is that the rak’ahs of Tahiyyat al-Masjid can be performed at any time, because the command of the Messenger of Allah ﷺ is general, as narrated from Abu Qatadah (may Allah be pleased with him):
اَنَّ رَسُوْلَ اللهِ صَلَّي اللهُ عَلَيْهِ وَسَلَّمَ قَالَ : اِذَا دَخَلَ اَحَدَكُمُ الْمَسْجِدَ فَلْيَرْكَعْ رَكْعَتَيْنِ قَبْلَ اَنْ يَّجْلِسَ
The Messenger of Allah ﷺ said: “When any one of you enters the mosque, let him pray two rak’ahs before he sits.”
It is narrated from Abu Qatadah (may Allah be pleased with him) in Sahih Muslim:
دَخَلْتُ الْمَسْجِدَ وَرَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ، جَالِسٌ بَيْنَ ظَهْرَانَي النَّاسِ، قَالَ: فَجَلَسْتُ، فَقَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: مَا مَنَعَكَ أَنْ تَرْكَعَ رَكْعَتَيْنِ قَبْلَ أَنْ تَجْلِسَ؟ قَالَ: فَقُلْتُ: يَا رَسُولَ اللَّهِ، رَأَيْتُكَ جَالِسًا، وَالنَّاسُ جُلُوسٌ، قَالَ: ” فَإِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ، فَلَا يَجْلِسْ حَتَّى يَرْكَعَ رَكْعَتَيْنِ
“I entered the mosque while the Messenger of Allah ﷺ was sitting among the people, and I went and sat down as well. The Messenger of Allah ﷺ said: ‘What prevented you from praying two rak’ahs before sitting?’ I said: ‘O Messenger of Allah! I saw you and the people sitting (so I sat).’ Then he ﷺ said: ‘Whenever any one of you enters the mosque, he should not sit before praying two rak’ahs.'”
It is learned from this hadith that these two rak’ahs are of great importance. When Abu Qatadah sat down without praying two rak’ahs, the Prophet ﷺ asked the reason for not praying two rak’ahs, and then gave the general command that a person who enters the mosque should not sit without praying two rak’ahs. The importance of these two rak’ahs can also be gauged from the fact that on the day of Jumu’ah no one is permitted to speak during the sermon, as Abu Hurayrah (may Allah be pleased with him) narrates that the Prophet ﷺ said:
إِذَا قُلْتَ لِصَاحِبِكَ اُسْكُتْ وَالْإِمَامُ يَخْطُبُ يَوْمَ الْجُمْعَةِ فَقَدْ لَغَوْتَ
“If you say to your companion ‘Be quiet’ on the day of Jumu’ah while the imam is delivering the sermon, then you have spoken idly.” Yet if, during the sermon, a person sits down without praying two rak’ahs, he too is commanded to pray two rak’ahs during that time, as narrated from Jabir (may Allah be pleased with him):
دَخَلَ رَجُلٌ الْمَسْجِدَ وَرَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يَخْطُبُ يَوْمَ الْجُمُعَةِ، فَقَالَ ” أَصَلَّيْتَ؟ ” قَالَ: لَا، قَالَ: ” قُمْ فَصَلِّ الرَّكْعَتَيْنِ “، وَفِي رِوَايَةِ قُتَيْبَةَ، قَالَ: صَلِّ رَكْعَتَيْنِ
“A man entered the mosque while the Messenger of Allah ﷺ was delivering the Jumu’ah sermon, and the Messenger of Allah ﷺ asked: ‘Have you prayed?’ He said: ‘No.’ He ﷺ said: ‘Stand up and pray two rak’ahs.'”
In one narration of Sahih Muslim, Sulayk al-Ghatafani (may Allah be pleased with him) came to the mosque on the day of Jumu’ah while the Prophet ﷺ was delivering the sermon, and he sat down. Upon this the Messenger of Allah ﷺ said:
“Whenever any one of you comes to the mosque on the day of Jumu’ah while the imam is delivering the sermon, he should pray two (rather) brief rak’ahs, and then sit.”
It is learned from these authentic hadiths that whenever a person enters the mosque, he should not sit without praying two rak’ahs. Praying these two rak’ahs is also necessary because they are among the prayers that have a cause, such as the prayer of tawaf and the prayer of a solar eclipse. All such prayers can be performed even during the prohibited times, as the Prophet ﷺ said regarding the eclipse prayer:
إِنَّ الشَّمْسَ وَالْقَمَرَ آيَتَانِ مِنْ آيَاتِ اللهِ
“Indeed the sun and the moon are two of the signs of Allah the Exalted.”