Sahih al-Bukhari 1170
Book 19: Prayer at Night (Tahajjud) · Hadith 49
Hadith text
حَدَّثَنَا آدَمُ، قَالَ أَخْبَرَنَا شُعْبَةُ، أَخْبَرَنَا عَمْرُو بْنُ دِينَارٍ، قَالَ سَمِعْتُ جَابِرَ بْنَ عَبْدِ اللَّهِ ـ رضى الله عنهما ـ قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم وَهُوَ يَخْطُبُ " إِذَا جَاءَ أَحَدُكُمْ وَالإِمَامُ يَخْطُبُ ـ أَوْ قَدْ خَرَجَ ـ فَلْيُصَلِّ رَكْعَتَيْنِ ".
Narrated Jabir bin `Abdullah:While delivering a sermon, Allah's Messenger (ﷺ) said, "If anyone of you comes while the Imam is delivering the sermon or has come out for it, he should offer a two rak`at prayer
Jabir bin Abdullah (رضی اللہ عنہ) bataate hain: Khutba dete waqt, Allah ke Rasool ne farmaya: "Agar tum mein se koi Imam ke khutba dete waqt aaye ya usi ke liye nikala ho, use do rakat padhni chahiye."
Sahih al-Bukhari 1170 · Book 19, Hadith 49