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.
Sunan Abi Dawud Book 40, Hadith 118