(15) بَابُ قَوْلِ اللَّهِ جَلَّ ذِكْرُهُ: {أُحِلَّ لَكُمْ لَيْلَةَ الصِّيَامِ الرَّفَثُ إِلَى نِسَائِكُمْ هُنَّ لِبَاسٌ لَكُمْ وَأَنْتُمْ لِبَاسٌ لَهُنَّ عَلِمَ اللَّهُ أَنَّكُمْ كُنْتُمْ تَخْتَانُونَ أَنْفُسَكُمْ فَتَابَ عَلَيْكُمْ وَعَفَا عَنْكُمْ فَالآنَ بَاشِرُوهُنَّ وَابْتَغُوا مَا كَتَبَ اللَّهُ لَكُمْ}
Narrated Al-Bara:
It was the custom among the companions of Muhammad that if any of them was fasting and the food was presented (for breaking his fast), but he slept before eating, he would not eat that night and the following day till sunset. Qais bin Sirma-al-Ansari was fasting and came to his wife at the time of Iftar (breaking one's fast) and asked her whether she had anything to eat. She replied, "No, but I would go and bring some for you." He used to do hard work during the day, so he was overwhelmed by sleep and slept. When his wife came and saw him, she said, "Disappointment for you." When it was midday on the following day, he fainted and the Prophet (ﷺ) was informed about the whole matter and the following verses were revealed: "You are permitted To go to your wives (for sexual relation) At the night of fasting." So, they were overjoyed by it. And then Allah also revealed: "And eat and drink Until the white thread Of dawn appears to you Distinct from the black thread (of the night)." (2.187)
Reference: Sahih al-Bukhari 1915
In-book reference: Book 30, Hadith 25
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 3, Book 31, Hadith 139