Sayyiduna Ibn Abbas (may Allah be pleased with them both) said: A man came to the Prophet (peace and blessings be upon him) and said: I have had (unlawful) contact with a woman short of (actual) intercourse. So Allah, the Mighty and Majestic, revealed this verse: "Establish the prayer at the two ends of the day and in some hours of the night" [Hud: 114].
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 12442