Abu Umama reported,

We were with the Messenger of Allah ﷺ in a gathering when a man came to him and said, "Messenger of Allah, I have committed an offense that requires a prescribed punishment, so carry out upon me the punishment of Allah's Book."The call to prayer was then made, and the Messenger of Allah ﷺ led us in prayer. When he finished, he left, and the man followed him, and I followed as well.The man said, "Messenger of Allah, I have committed an offense that requires a prescribed punishment, so carry out upon me the punishment of Allah's Book."The Prophet ﷺ said to him, "Did you not leave your home, perform ablution well, and pray with us?"The man replied, "Yes."The Prophet said, "Then Allah عز وجل has forgiven you your offense," or "your sin."

Ahmad 22163

Sahih

حدثنا زيد بن الحباب حدثني عكرمة بن عمار اليمامي عن شداد بن عبد الله

عن أبي أمامة قال

كنا مع رسول الله ﷺ في مجلس فجاءه رجل فقال يا رسول الله أصبت حدا فأقم علي كتاب الله قال فأقيمت الصلاة قال فصلى بنا رسول الله ﷺ فلما فرغ خرج رسول الله ﷺ وتبعه الرجل وتبعته فقال يا رسول الله أصبت حدا فأقم علي كتاب الله فقال له النبي ﷺ أليس خرجت من منزلك توضأت فأحسنت الوضوء وصليت معنا قال الرجل بلى قال فإن الله عز وجل قد غفر لك حدك أو ذنبك

أحمد 22163صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Abu Umama Bahili
Numbering
Darussalam 22163
Ahmad 22163