Abu Umama reported,

While the Messenger of Allah ﷺ was in the mosque and we were sitting with him, a man came and said, "Messenger of Allah, I have committed an offense that requires a prescribed punishment, so carry it out on me."The Messenger of Allah ﷺ remained silent. Then the call to begin the prayer was made, and after the Prophet of Allah ﷺ finished praying, the man followed him.Abu Umama said, "I followed the Messenger of Allah ﷺ to see how he would respond to the man."The man caught up with the Messenger of Allah ﷺ and said, "Messenger of Allah, I have committed an offense that requires a prescribed punishment, so carry it out on me."Abu Umama said, the Messenger of Allah ﷺ then asked him, "When you left your house, did you not perform ablution and perform it well?"He replied, "Yes, Messenger of Allah."The Prophet asked, "Then did you pray with us?"He answered, "Yes, Messenger of Allah."The Messenger of Allah ﷺ said to him, "Then Allah has forgiven you your prescribed punishment," or he said, "your sin."

Azami 6953

Sahih

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

بينما رسول الله ﷺ في المسجد، ونحن قعود معه، إذ جاء رجل فقال: يا رسول الله إني أصبت حدا فأقمه علي، فسكت عنه رسول الله ﷺ وأقيمت الصلاة، فلما انصرف نبي الله ﷺ قال أبو أمامة: فاتبع الرجل رسول الله ﷺ حين انصرف. واتبعت رسول الله ﷺ أنظر ما يرد على الرجل، فلحق الرجل رسول الله ﷺ فقال: يا رسول الله إني أصبت حدا فأقمه علي. قال أبو أمامة: فقال له رسول الله ﷺ: أرأيت حين خرجت من بيتك، أليس قد توضأت فأحسنت الوضوء؟ قال: بلي يا رسول الله! قال: ثم شهدت الصلاة معنا؟ فقال: نعم يا رسول الله. قال: فقال له رسول الله ﷺ: فإن الله قد غفر لك حدك- أو قال: ذنبك

الأعظمي 6953صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Legal punishments
Chapter
Hadd of zina
Section
Stoning of Maez bin Malik
Numbering
Jami al-Kamil 6953 (2nd edition)
Azami 6953