The Prophet (ﷺ) said, "If anyone of you enters a Mosque, he should not sit until he has offered a tworak` at prayer."
Prayer at Night (Tahajjud)
Sahih al-Bukhari - Hadith 1167
Hadith Text
The Prophet (ﷺ) said, "If anyone of you enters a Mosque, he should not sit until he has offered a two rak'at prayer."
Scholarly Commentary
This noble hadith establishes the sunnah of offering two rak'at of prayer upon entering the mosque, known as "Tahiyyat al-Masjid" (Greeting of the Mosque). The scholars have explained that this prayer serves as a means of honoring the sanctity of the mosque and preparing oneself spiritually before engaging in worship or sitting for remembrance.
Imam al-Nawawi states in his commentary that this prayer is strongly recommended (sunnah mu'akkadah) and should be performed before sitting, unless one is engaged in obligatory prayer or other pressing religious duties. The wisdom behind this practice is to transition from worldly affairs to spiritual devotion, making the mosque a place dedicated solely for worship.
The Hanafi scholars consider it wajib (obligatory), while the majority view it as a confirmed sunnah. If one forgets and sits, they should stand up and perform the prayer. This teaching emphasizes the respect due to houses of worship and the importance of beginning one's visit with direct communion with Allah.