(32) باب فِي الرَّجُلِ يُصِيبُ مِنَ الْمَرْأَةِ دُونَ الْجِمَاعِ فَيَتُوبُ قَبْلَ أَنْ يَأْخُذَهُ الإِمَامُ
'Abd Allah (b. Mas'ud) said:
A man came to the Prophet (ﷺ) and said: I contacted directly a women at the furthest part of the city (i.e., Medina), and I did with her everything except sexual intercourse. So here I am; inflict any punishment you wish. Thereupon 'Umar said: Allah has concealed your fault; it would have been better if you also had concealed it yourself. The Prophet (ﷺ) sent a men after him. (When he came) he recited the verse: "And establish regular prayers at the two ends of the day and at the approaches of the night. . ." up to the end of the verse. A man from the people got up and asked: Is it particular to him, Messenger of Allah, or for the people in general? He replied: It is all the people.
Reference: Sunan Abi Dawud 4468
In-book reference: Book 40, Hadith 118
English translation: Book 39, Hadith 4453