عَنْ عَبْدِ اللَّهِ بْنِ كَعْبِ بْنِ مَالِكٍ رَضِيَ اللَّهُ عَنْهُ يُحَدِّثُ عَنْ أَبِيهِ قَالَ كَانَ النَّاسُ فِي رَمَضَانَ إِذَا صَامَ الرَّجُلُ فَأَمْسَى فَنَامَ حَرُمَ عَلَيْهِ الطَّعَامُ وَالشَّرَابُ وَالنِّسَاءُ حَتَّى يُفْطِرَ مِنَ الْغَدِ فَرَجَعَ عُمَرُ بْنُ الْخَطَّابِ رَضِيَ اللَّهُ عَنْهُ مِنْ عِنْدِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ ذَاتَ لَيْلَةٍ وَقَدْ سَهِرَ عِنْدَهُ فَوَجَدَ امْرَأَتَهُ قَدْ نَامَتْ فَأَرَادَهَا فَقَالَتْ إِنِّي قَدْ نِمْتُ قَالَ مَا نِمْتِ ثُمَّ وَقَعَ بِهَا وَصَنَعَ كَعْبُ بْنُ مَالِكٍ مِثْلَ ذَلِكَ فَغَدَا عُمَرُ إِلَى النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ فَأَخْبَرَهُ فَأَنْزَلَ اللَّهُ تَعَالَى عَلِمَ اللَّهُ أَنَّكُمْ كُنْتُمْ تَخْتَانُونَ أَنْفُسَكُمْ فَتَابَ عَلَيْكُمْ وَعَفَا عَنْكُمْ [سورة البقرة: ١٨٧]
Sayyiduna Ka'b bin Malik (may Allah be pleased with him) narrates that (in the beginning) when people used to fast in Ramadan, and if a person slept after the evening, that is, after sunset, then eating, drinking, and relations with wives would become forbidden for him, until he would break his fast the next day. One night, Sayyiduna Umar (may Allah be pleased with him) stayed awake with the Noble Prophet (peace and blessings be upon him) and returned home late. When he arrived, he saw that his wife had fallen asleep. When he wished to have relations with her, she said: "I have fallen asleep (therefore, now relations are not permissible)," but Sayyiduna Umar (may Allah be pleased with him) said: "You have not slept," and then he fulfilled his marital right. Similarly, Sayyiduna Ka'b bin Malik (may Allah be pleased with him) did the same. When Sayyiduna Umar (may Allah be pleased with him) went to the Noble Prophet (peace and blessings be upon him) and informed him of his action, Allah Almighty revealed this verse: {عَلِمَ اللّٰہُ أَ نَّکُمْ کُنْتُمْ تَخْتَانُونَ أَ نْفُسَکُمْ فَتَابَ عَلَیْکُمْ وَعَفَا عَنْکُمْ}