Sahih al-Bukhari
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
حَدَّثَنَا عُبَيْدُ اللَّهِ، عَنْ إِسْرَائِيلَ، عَنْ أَبِي إِسْحَاقَ، عَنِ الْبَرَاءِ، وَحَدَّثَنَا أَحْمَدُ بْنُ عُثْمَانَ، حَدَّثَنَا شُرَيْحُ بْنُ مَسْلَمَةَ، قَالَ حَدَّثَنِي إِبْرَاهِيمُ بْنُ يُوسُفَ، عَنْ أَبِيهِ، عَنْ أَبِي إِسْحَاقَ، قَالَ سَمِعْتُ الْبَرَاءَ ـ رضى الله عنه ـ. لَمَّا نَزَلَ صَوْمُ رَمَضَانَ كَانُوا لاَ يَقْرَبُونَ النِّسَاءَ رَمَضَانَ كُلَّهُ، وَكَانَ رِجَالٌ يَخُونُونَ أَنْفُسَهُمْ، فَأَنْزَلَ اللَّهُ {عَلِمَ اللَّهُ أَنَّكُمْ كُنْتُمْ تَخْتَانُونَ أَنْفُسَكُمْ فَتَابَ عَلَيْكُمْ وَعَفَا عَنْكُمْ}.
Narrated Al-Bara':
When the order of compulsory fasting of Ramadan was revealed, the people did not have sexual relations with their wives for the whole month of Ramadan, but some men cheated themselves (by violating that restriction). So Allah revealed: "Allah is aware that you were deceiving yourselves but He accepted your repentance and forgave you.." (3:187)
Full reference and source
Sahih al-Bukhari USC-MSA web (English) : Vol. 6, Book 60, Hadith 35 Arabic : Book 65, Hadith 4508
View source on Sunnah.com (opens in a new tab)