Abdullah bin Masud reported,

A man came to the Prophet ﷺ and said, "I was intimate with a woman from the far end of Medina, and I took from her everything short of intercourse. Here I am, so impose on me whatever penalty you wish."Umar said, "Allah had concealed your sin. You should have concealed it yourself."The Prophet ﷺ gave him no reply, so the man left. Then the Prophet ﷺ sent someone after him to call him back, and he recited to him, "And establish prayer at the two ends of the day and during parts of the night. Indeed, good deeds drive away bad deeds. That is a reminder for those who remember" [Hud 11:114].A man from the gathering asked, "Messenger of Allah, is this for him alone or for all people?"He replied, "For all people."

Abu Dawud 4468

Sahih

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

قال عبد الله

جاء رجل إلى النبي ﷺ فقال إني عالجت امرأة من أقصى المدينة فأصبت منها ما دون أن أمسها فأنا هذا فأقم علي ما شئت فقال عمر قد ستر الله عليك لو سترت على نفسك فلم يرد عليه النبي ﷺ شيئا فانطلق الرجل فأتبعه النبي ﷺ رجلا فدعاه فتلا عليه {وأقم الصلاة طرفي النهار وزلفا من الليل} إلى آخر الآية فقال رجل من القوم يا رسول الله أله خاصة أم للناس كافة فقال للناس كافة

أبو داود 4468صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Abu Dawud
Book
Legal punishments
Chapter
A man who commits an act with a woman short of intercourse, then repents before the imam apprehends him
Numbering
Darussalam 4468
Abu Dawud 4468