Once Iqama was pronounced and the people had straightened the rows, Messenger of Allah ﷺ went forward (to lead the prayer) but he was Junub, so he said, "Remain in your places." And he went out, took a bath and returned with water trickling from his head. Then he led the prayer.
أُقِيمَتِ الصَّلاَةُ فَسَوَّى النَّاسُ صُفُوفَهُمْ فَخَرَجَ رَسُولُ اللَّهِ ﷺ فَتَقَدَّمَ وَهْوَ جُنُبٌ ثُمَّ قَالَ عَلَى مَكَانِكُمْ فَرَجَعَ فَاغْتَسَلَ ثُمَّ خَرَجَ وَرَأْسُهُ يَقْطُرُ مَاءً فَصَلَّى بِهِمْ