The Two Rak’ahs of Tahiyyat al-Masjid
➊ It is narrated from Abu Qatadah (may Allah be pleased with him) that the Messenger of Allah ﷺ said:
إذا دخل أحدكم المسجد فلا يجلس حتى يصلى ركعتين
“When any of you enters the mosque, he should pray two rak’ahs before sitting.”
➋ When Jabir (may Allah be pleased with him) came to the mosque to receive the price of his camel from the Prophet ﷺ, the Prophet ﷺ commanded him:
أن يصلى الركعتين
“To pray two rak’ahs.”
➌ It is narrated from Jabir (may Allah be pleased with him) that during the sermon the Prophet ﷺ commanded Sulayk al-Ghatafani (may Allah be pleased with him), who had sat down without praying two rak’ahs:
ان يصليهما
“To pray two rak’ahs.”
The scholars differ concerning the ruling on this.
(Ahl al-Zahir) Imam Ibn Battal (may Allah have mercy on him) has narrated from them that it is obligatory.
(The majority) The command regarding Tahiyyat al-Masjid is for recommendation.
(Amir al-San’ani, may Allah have mercy on him) It is more apparent that it is obligatory.
(Shawkani, may Allah have mercy on him) (After discussing this issue he says: from the preceding evidences you will know that) the view of Ahl al-Zahir, that is, obligation, is more apparent.
(The preferred view) According to our knowledge, Tahiyyat al-Masjid is not obligatory but is a confirmed sunnah and a recommended act. والله اعلم
The scholars who hold this position keep in view the following evidences:
➊ When the Prophet ﷺ told Dimam ibn Tha’labah (may Allah be pleased with him) that the obligatory prayers are five in number, he said: هل على غيرها؟ “Is there anything else obligatory upon me besides these prayers?” The Prophet ﷺ said: لا ، إلا أن تطوع “No, unless you pray something voluntarily.”
➋ In one narration it says:
كان أصحاب رسول الله صلى الله عليه وسلم يدخلون المسجد ثم يخرجون ولا يصلون
“The Companions of the Messenger of Allah ﷺ would enter the mosque and then leave, and they would not pray any prayer (that is, Tahiyyat al-Masjid etc.).”
➌ When Ka’b ibn Malik (may Allah be pleased with him) stayed behind from the expedition of Tabuk. (In this hadith it is mentioned that) the Prophet ﷺ said to Ka’b (may Allah be pleased with him):
تعال فجئت حتى جلست بين يديه فقم حتى يقضى الله فيك فقمت فمضيت
“Come here, so I came until I sat down in front of him (that is, in the mosque)” (then the Prophet ﷺ said) “Get up and go until Allah decides concerning you” (Ka’b, may Allah be pleased with him, says:) “So I got up and went.”
In this same narration it is mentioned that the Prophet ﷺ called Ka’b (may Allah be pleased with him) at a time when the Prophet ﷺ was in the mosque.
➍ It is narrated through successive transmission (tawatur) from the Messenger of Allah ﷺ that on the day of Jumu’ah he would enter the mosque, sit on the pulpit, and would not pray any prayer before finishing the sermon.
➎ To the man who was stepping over people’s necks on Friday, the Prophet ﷺ said: اجلس فقد آذيت “Sit down; you have certainly caused harm.”
(Ibn Hajar, may Allah have mercy on him) The imams who issue fatwas agree that the command in this (that is, the preceding) hadith is for recommendation.
(Ibn Hazm, may Allah have mercy on him) These two rak’ahs are not obligatory.
(Nawawi, may Allah have mercy on him) The Muslims are in consensus on this (that is, on it not being obligatory).
(Ibn Qudamah, may Allah have mercy on him) Praying these rak’ahs before sitting in the mosque is sunnah.
If someone forgets and sits down without praying these rak’ahs
then when he remembers, he should stand up again and pray these rak’ahs and then sit, just as the Prophet ﷺ commanded a man during the sermon: قم فصل ركعتين “Get up and pray two rak’ahs.” Similarly, when Abu Dharr (may Allah be pleased with him) entered the mosque and sat down, the Prophet ﷺ asked: اركعت ركعتين؟ “Have you prayed two rak’ahs?” He said, “No.” So the Prophet ﷺ said: قم فاركعهما “Get up and pray these two rak’ahs.”
If the congregation has been lined up and someone comes to the mosque
he should join the congregational prayer; there is no need for him to pray Tahiyyat al-Masjid. This will suffice for him.
As it is also stated in a narration:
إذا أقيمت الصلاة فلا صلاة إلا المكتوبة
“When the iqamah has been called for the prayer, then there is no prayer except the obligatory one.”
The ruling on Tahiyyat al-Masjid during the prohibited times
It appears that these rak’ahs may be prayed even during the prohibited times, as the Shafi’is hold. However, Imam Abu Hanifah (may Allah have mercy on him), Imam al-Awza’i (may Allah have mercy on him) and Imam al-Layth (may Allah have mercy on him) say that Tahiyyat al-Masjid is disliked during these times. The preferred view appears to be that it is better to refrain from prayer during these times, even if its permissibility is established.
(Ibn Taymiyyah, Ibn al-Qayyim, may Allah have mercy on them) Praying Tahiyyat al-Masjid is permissible at all times.
(Ibn Baz, may Allah have mercy on him) holds the same view.