سنن نسائي Sunan an-Nasa'i كتاب الإمامة The Book of Leading the Prayer (Al-Imamah)
بَابُ : الإِمَامِ يَذْكُرُ بَعْدَ قِيَامِهِ فِي مُصَلاَّهُ أَنَّهُ عَلَى غَيْرِ طَهَارَةٍ

Chapter: After standing in the place where he prays, the Imam remembers that he is not in a state of purity

1 hadith
Hadith 793
أَخْبَرَنَا عَمْرُو بْنُ عُثْمَانَ بْنِ سَعِيدِ بْنِ كَثِيرٍ ، قال : حَدَّثَنَا مُحَمَّدُ بْنُ حَرْبٍ ، عَنِ الزُّبَيْدِيِّ ، عَنِ الزُّهْرِيِّ ، وَالْوَلِيدُ ، عَنِ الْأَوْزَاعِيِّ ، عَنِ الزُّهْرِيِّ ، عَنْ أَبِي سَلَمَةَ ، عَنْ أَبِي هُرَيْرَةَ ، قال : أُقِيمَتِ الصَّلَاةُ فَصَفَّ النَّاسُ صُفُوفَهُمْ " وَخَرَجَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ حَتَّى إِذَا قَامَ فِي مُصَلَّاهُ ذَكَرَ أَنَّهُ لَمْ يَغْتَسِلْ فَقَالَ لِلنَّاسِ مَكَانَكُمْ ، ثُمَّ رَجَعَ إِلَى بَيْتِهِ فَخَرَجَ عَلَيْنَا يَنْطِفَ رَأْسُهُ فَاغْتَسَلَ وَنَحْنُ صُفُوفٌ " .
´It was narrated that Abu Hurairah said:` "The Iqamah for prayer was said and the people stood in rows, and the Messenger of Allah (ﷺ) came out. Then when he stood in the place where he prayed, he remembered that he had not performed Ghusl. He said to the people: 'Stay where you are.' Then he went back to his house, then he came out with his head dripping with water. He performed Ghusl while we were standing in our rows."
Hadith Reference Sunan an-Nasa'i / The Book of Leading the Prayer (Al-Imamah) / Hadith: 793
Hadith Grading الألبانی: صحيح  |  زبیر علی زئی: متفق عليه
Hadith Takhrij «صحیح البخاری/الأذان 25 (639، 640)، صحیح مسلم/المساجد 29 (605)، سنن ابی داود/الطھارة 94 (235)، الصلاة 46 (541)، (تحفة الأشراف: 15200)، مسند احمد 2/237، 259، 283، 338، 339 (صحیح)»