Sayyiduna Mu'adh bin Jabal (may Allah be pleased with him) said: I was sitting with the Prophet (peace and blessings be upon him) when a man came and said: O Messenger of Allah! A man touched a woman who was not lawful for him, and he did everything that a man does with his wife except that he did not have intercourse with her. He (peace and blessings be upon him) said: "Perform ablution well, then stand and pray." Then Allah, the Mighty and Majestic, revealed this verse: "And establish the prayer at the two ends of the day and in some hours of the night. Indeed, good deeds wipe out evil deeds. That is a reminder for those who take heed" [Hud: 114]. Mu'adh (may Allah be pleased with him) said: O Messenger of Allah! Is this specifically for him, or for the Muslims in general? He (peace and blessings be upon him) said: "For the Muslims in general."
Hadith Referenceالمعجم الكبير للطبراني / باب الميم / 17414