(48) باب مَنْ دَخَلَ لِيَؤُمَّ النَّاسَ فَجَاءَ الإِمَامُ الأَوَّلُ فَتَأَخَّرَ الأَوَّلُ أَوْ لَمْ يَتَأَخَّرْ جَازَتْ صَلاَتُهُ
Narrated Sahl bin Sa`d As-Sa`idi:
Allah's Messenger (ﷺ) went to establish peace among Bani `Amr bin `Auf. In the meantime the time of prayer was due and the Mu'adh-dhin went to Abu Bakr and said, "Will you lead the prayer, so that I may pronounce the Iqama?" Abu Bakr replied in the affirmative and led the prayer. Allah's Messenger (ﷺ) came while the people were still praying and he entered the rows of the praying people till he stood in the (first row). The people clapped their hands. Abu Bakr never glanced sideways in his prayer but when the people continued clapping, Abu Bakr looked and saw Allah's Messenger (ﷺ). Allah's Messenger (ﷺ) beckoned him to stay at his place. Abu Bakr raised his hands and thanked Allah for that order of Allah's Messenger (ﷺ) and then he retreated till he reached the first row. Allah's Messenger (ﷺ) went forward and led the prayer. When Allah's Messenger (ﷺ) finished the prayer, he said, "O Abu Bakr! What prevented you from staying when I ordered you to do so?" Abu Bakr replied, "How can Ibn Abi Quhafa (Abu Bakr) dare to lead the prayer in the presence of Allah's Messenger (ﷺ)?" Then Allah's Messenger (ﷺ) said, "Why did you clap so much? If something happens to anyone during his prayer he should say Subhan Allah. If he says so he will be attended to, for clapping is for women."
Reference: Sahih al-Bukhari 684
In-book reference: Book 10, Hadith 78
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 1, Book 11, Hadith 652