Kaab bin Malik reported,

During Ramadan, the people followed this rule. If a man was fasting and evening came, then he slept, food, drink, and intimacy with women became forbidden to him until he broke his fast the next day.One night, Umar bin Khattab returned from the Prophet ﷺ, having stayed up late with him, and found that his wife had already fallen asleep. He desired her, but she said, "I have already slept."He replied, "You have not slept," and then had relations with her.Kaab bin Malik did something similar. The next morning, Umar went to the Prophet ﷺ and informed him about it, and Allah the Exalted revealed, "Allah knows that you used to deceive yourselves, so He accepted your repentance and pardoned you" [Baqarah 2:187].

Azami 11961

Hasan

عن كعب بن مالك، قال

كان الناس في رمضان إذا صام الرجل فأمسي، فنام، حرم عليه الطعام والشراب والنساء حتى يفطر من الغد، فرجع عمر بن الخطاب من عند النبي ﷺ ذات ليلة وقد سهر عنده، فوجد امرأته قد نامت، فأرادها، فقالت: إني قد نمت، قال: ما نمت، ثم وقع بها، وصنع كعب بن مالك مثل ذلك، فغدا عمر إلى النبي ﷺ فأخبره، فأنزل الله تعالى: {علم الله أنكم كنتم تختانون أنفسكم فتاب عليكم وعفا عنكم}

الأعظمي 11961حسن
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Virtues of Surah Baqarah
Section
His saying, "It has been made permissible for you the night preceding fasting to go to your wives. They are clothing for you and you are clothing for them. Allah knows that you used to deceive yourselves, so He turned to you in forgiveness and pardoned you. So now have relations with them and seek that which Allah has decreed for you. And eat and drink until the white thread of dawn becomes distinct to you from the black thread of Fajr. Then complete the fast until the night. And do not have relations with them as long as you are staying for worship in the mosques. These are the limits of Allah, so do not approach them. Thus does Allah make clear His verses to the people."
Numbering
Jami al-Kamil 11961 (2nd edition)
Azami 11961