Two rak'ahs before sitting

On entering the masjid, pray two rak'ahs before you sit down.

Narrated by Abu Qatadah

When one of you enters the masjid, let him pray two rak'ahs before he sits down.

Sahih al-Bukhari 444, Sahih Muslim 714

What this hadith teaches

This is tahiyyat al-masjid, the greeting of the masjid. It applies even when the Friday khutbah is going on.

Reference and grade

Grade
Sahih: agreed upon by al-Bukhari and Muslim
Narrator
Abu Qatadah
Chapter
The masjid

The hadith in Arabic نص الحديث

إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ فَلْيَرْكَعْ رَكْعَتَيْنِ قَبْلَ أَنْ يَجْلِسَ

Arabic text of Sahih al-Bukhari 444, as given on sunnah.com.