It is narrated from Sayyiduna Ibn Mas'ud (may Allah be pleased with him) that once a man came to the Prophet (peace and blessings be upon him) and said: O Messenger of Allah! I have done everything with a woman except intercourse. Upon this, Allah revealed this verse: «﴿وَأَقِمِالصَّلَاةَطَرَفَيِالنَّهَارِوَزُلَفًامِنَاللَّيْلِإِنَّالْحَسَنَاتِيُذْهِبْنَالسَّيِّئَاتِ﴾»[هود : 114] "Establish prayer at the two ends of the day and at some hours of the night. Indeed, good deeds erase bad deeds."
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 3854
Hadith Gradingحکم دارالسلام:حديث صحيح، خ: 526، م: 2763، وهذا إسناد ضعيف، الحسن بن يحيى المروزي مجهول.