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].
كان الناس في رمضان إذا صام الرجل فأمسي، فنام، حرم عليه الطعام والشراب والنساء حتى يفطر من الغد، فرجع عمر بن الخطاب من عند النبي ﷺ ذات ليلة وقد سهر عنده، فوجد امرأته قد نامت، فأرادها، فقالت: إني قد نمت، قال: ما نمت، ثم وقع بها، وصنع كعب بن مالك مثل ذلك، فغدا عمر إلى النبي ﷺ فأخبره، فأنزل الله تعالى: {علم الله أنكم كنتم تختانون أنفسكم فتاب عليكم وعفا عنكم}
Ahmad (15795) narrated it from Itaab bin Ziyad, who said, Abdullah told us, who said, Ibn Lahia told us, who said, Musa bin Jubayr told me, and he related it. Its isnad is hasan because of Musa bin Jubayr, for a group of narrators reported from him, and Ibn Hibban mentioned him among the trustworthy narrators. There is well-known discussion about Ibn Lahia, but the narration of Abdullah bin Mubarak, one of the Abadila, is more reliable and more sahih than that of others.This is supported by what Ibn Mardawayh narrated through Hushaym, from Husayn bin Abdul-Rahman, from Abdul-Rahman bin Abu Layla, who said, Umar bin Khattab stood up and said, "Messenger of Allah, last night I wanted my wife the way a man wants his wife, but she said, 'I have already gone to sleep.' I thought she was making an excuse, so I had intercourse with her." Then, concerning Umar, the verse was revealed, "It has been made lawful for you, on the night of fasting, to approach your wives" [Baqarah 2:187].Ibn Kathir mentioned this and said, this is how Shuba narrated it, from Amr bin Mura, from Ibn Abu Layla. There is disagreement over whether Ibn Abu Layla heard directly from Umar bin Khattab, and the sahih view is that he did not hear from him.