Abu Hurairah reported,

The prayer was called and the people straightened their rows. The Messenger of Allah ﷺ came out and stepped forward, but he was in a state of major impurity. He said, "Stay in your places," then he went back, performed the ritual bath, and came out again with water dripping from his head, and led them in prayer.

Bukhari 640

Sahih

حدثنا إسحاق قال حدثنا محمد بن يوسف قال حدثنا الأوزاعي عن الزهري عن أبي سلمة بن عبد الرحمن

عن أبي هريرة قال

أقيمت الصلاة فسوى الناس صفوفهم فخرج رسول الله ﷺ فتقدم وهو جنب ثم قال على مكانكم فرجع فاغتسل ثم خرج ورأسه يقطر ماء فصلى بهم

البخاري 640صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Adhan
Chapter
If the imam says "Stay in your places" until he returns, they should wait for him
Numbering
Darussalam 640
Bukhari 640