Bara bin Azib reported,

When the fasting of Ramadan was prescribed, the people would not approach their wives for the whole of Ramadan, yet some men were betraying themselves in this. So Allah revealed, "Allah knows that you were deceiving yourselves, so He turned to you in forgiveness and pardoned you" [Baqarah 2:187].

Azami 11957

Sahih

عن البراء قال

لما نزل صوم رمضان كانوا لا يقربون النساء رمضان كله، وكان رجال يخونون أنفسهم فأنزل الله: {علم الله أنكم كنتم تختانون أنفسكم فتاب عليكم وعفا عنكم}

الأعظمي 11957صحيح
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 11957 (2nd edition)
Azami 11957