Hadith 36396

Chapter 11

باب 11

(11) باب اسْتِحْبَابِ تَحِيَّةِ الْمَسْجِدِ بِرَكْعَتَيْنِ وَكَرَاهَةِ الْجُلُوسِ قَبْلَ صَلاَتِهِمَا وَأَنَّهَا مَشْرُوعَةٌ فِي جَمِيعِ الأَوْقَاتِ

(11) Chapter: It is recommended to greet the masjid by praying two rak`ah, and it is disliked to sit before praying these two rak`ah, and this is prescribed at all times
84
حَدَّثَنَا عَبْدُ اللَّهِ بْنُ مَسْلَمَةَ بْنِ قَعْنَبٍ، وَقُتَيْبَةُ بْنُ سَعِيدٍ، قَالاَ حَدَّثَنَا مَالِكٌ، ح وَحَدَّثَنَا يَحْيَى بْنُ يَحْيَى، قَالَ قَرَأْتُ عَلَى مَالِكٍ عَنْ عَامِرِ بْنِ عَبْدِ اللَّهِ بْنِ الزُّبَيْرِ، عَنْ عَمْرِو بْنِ سُلَيْمٍ الزُّرَقِيِّ، عَنْ أَبِي قَتَادَةَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ " إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ فَلْيَرْكَعْ رَكْعَتَيْنِ قَبْلَ أَنْ يَجْلِسَ " .

Abu Qatada (a Companion of the Prophet) reported Allah's Messenger (ﷺ) as saying:
When any one of you enters the mosque, he should observe two rak'ahs (of Nafl prayer) before sitting.

Reference: Sahih Muslim 714 a

In-book reference: Book 6, Hadith 84

USC-MSA web (English) reference(deprecated numbering scheme): Book 4, Hadith 1540