Abbad bin Ziyad reported that Urwa bin Mughira bin Shuba informed him that he heard his father Mughira say:The Messenger of Allah ﷺ turned aside before dawn during the expedition of Tabuk, and I was with him, so I turned aside with him. The Prophet ﷺ made his camel kneel and went to relieve himself. Then he came back and I poured water from the vessel onto his hand. He washed his palms, then washed his face. Then he tried to roll up his sleeves but his cloak was too tight, so he pulled his arms inside and brought them out from beneath the cloak. He washed them up to the elbows and wiped his head, then performed wiping over his leather socks. Then he mounted his camel.We rode on until we found the people already in prayer. They had put Abdul-Rahman bin Awf forward, and he had led them in prayer when the time came. We found that Abdul-Rahman had already led them in one rakah of the dawn prayer.The Messenger of Allah ﷺ stood and joined the row with the Muslims, praying the second rakah behind Abdul-Rahman bin Awf. When Abdul-Rahman gave the salutation, the Messenger of Allah ﷺ stood up to complete his prayer. The Muslims became alarmed and began saying "Subhan Allah" repeatedly, because they had preceded the Prophet ﷺ in the prayer.When the Messenger of Allah ﷺ gave the salutation, he said to them, "You have done right," or, "You have done well."
حدثنا أحمد بن صالح حدثنا عبد الله بن وهب أخبرني يونس بن يزيد
عباد بن زياد أن عروة بن المغيرة بن شعبة أخبره أنه سمع أباه المغيرة يقول عدل رسول الله ﷺ وأنا معه في غزوة تبوك قبل الفجر فعدلت معه فأناخ النبي ﷺ فتبرز ثم جاء فسكبت على يده من الإداوة فغسل كفيه ثم غسل وجهه ثم حسر عن ذراعيه فضاق كما جبته فأدخل يديه فأخرجهما من تحت الجبة فغسلهما إلى المرفق ومسح برأسه ثم توضأ على خفيه ثم ركب فأقبلنا نسير حتى نجد الناس في الصلاة قد قدموا عبد الرحمن بن عوف فصلى بهم حين كان وقت الصلاة ووجدنا عبد الرحمن وقد ركع بهم ركعة من صلاة الفجر فقام رسول الله ﷺ فصف مع المسلمين فصلى وراء عبد الرحمن بن عوف الركعة الثانية ثم سلم عبد الرحمن فقام رسول الله ﷺ في صلاته ففزع المسلمون فأكثروا التسبيح لأنهم سبقوا النبي ﷺ بالصلاة فلما سلم رسول الله ﷺ قال لهم قد أصبتم أو قد أحسنتم
Muslim also recorded it in the Book of Prayer, in the chapter on the congregation putting forward someone to lead them in prayer when the imam is delayed, etc., hadith no. 274 after hadith no. 421, from the hadith of Ibn Shihab Zuhri through the same route.