| 2 Bukhari hadiths


444 - It was narrated from Abu Qatadah al-Salami that the Messenger of Allah (blessings and peace of Allah be upon him) said: “When one of you enters the mosque, let him pray two rak‘ahs before he sits down.”.

Commentary : The prayer to “greet the mosque” (tahiyyat al-masjid) is a Sunnah that was enjoined by the Prophet (blessings and peace of Allah be upon him). In this hadith, the Prophet (blessings and peace of Allah be upon him) instructs the one who comes and enters the mosque at any time – whether that is to pray, to await the prayer, to seek knowledge and so on – to pray two rak‘ahs before he sits down. These are the two rak‘ahs that are done to greet the mosque. This is a general ruling that applies when entering any mosque except al-Masjid al-Haram; in that case the greeting is done by circumambulating the Kaaba seven times. This hadith is specifically addressed to the one who enters the mosque when the call immediately preceding an obligatory prayer (iqamah) has not been given. If the iqamah has been given, then joining the prayer takes precedence over these two rak‘ahs.
This hadith indicates that it is encouraged to pray two rak‘ahs to greet the mosque before sitting down..