أَخْبَرَنَا عَمْرُو بْنُ عُثْمَانَ بْنِ سَعِيدِ بْنِ كَثِيرٍ، قَالَ حَدَّثَنَا مُحَمَّدُ بْنُ حَرْبٍ، عَنِ الزُّبَيْدِيِّ، عَنِ الزُّهْرِيِّ، وَالْوَلِيدُ، عَنِ الأَوْزَاعِيِّ، عَنِ الزُّهْرِيِّ، عَنْ أَبِي سَلَمَةَ، عَنْ أَبِي هُرَيْرَةَ، قَالَ أُقِيمَتِ الصَّلاَةُ فَصَفَّ النَّاسُ صُفُوفَهُمْ وَخَرَجَ رَسُولُ اللَّهِ صلى الله عليه وسلم حَتَّى إِذَا قَامَ فِي مُصَلاَّهُ ذَكَرَ أَنَّهُ لَمْ يَغْتَسِلْ فَقَالَ لِلنَّاسِ ‏"‏ مَكَانَكُمْ ‏"‏ ‏.‏ ثُمَّ رَجَعَ إِلَى بَيْتِهِ فَخَرَجَ عَلَيْنَا يَنْطِفُ رَأْسُهُ فَاغْتَسَلَ وَنَحْنُ صُفُوفٌ ‏.‏

It was narrated that Abu Hurairah said: "The Iqamah for prayer was said and the people stood in rows, and the Messenger of Allah (PBUH) 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." Translation Not Available

Book Ref: Sunan An Nisai Book 10 Hadith 792
Web Ref:  Sunan An Nisai Vol 1 Book 10 Hadith 793