Hadithcore
Sahih al-Bukhari, 526
sahih

Narrated Ibn Mas`ud:

A man kissed a woman (unlawfully) and then went to the Prophet (ﷺ) and informed him. Allah revealed: And offer prayers perfectly At the two ends of the day And in some hours of the night (i.e. the five compulsory prayers). Verily! good deeds remove (annul) the evil deeds (small sins) (11:114). The man asked Allah's Messenger (ﷺ) , "Is it for me?" He said, "It is for all my followers."

حَدَّثَنَا قُتَيْبَةُ، قَالَ حَدَّثَنَا يَزِيدُ بْنُ زُرَيْعٍ، عَنْ سُلَيْمَانَ التَّيْمِيِّ، عَنْ أَبِي عُثْمَانَ النَّهْدِيِّ، عَنِ ابْنِ مَسْعُودٍ، أَنَّ رَجُلاً، أَصَابَ مِنَ امْرَأَةٍ قُبْلَةً، فَأَتَى النَّبِيَّ صلى الله عليه وسلم فَأَخْبَرَهُ، فَأَنْزَلَ اللَّهُ ‏{‏أَقِمِ الصَّلاَةَ طَرَفَىِ النَّهَارِ وَزُلَفًا مِنَ اللَّيْلِ إِنَّ الْحَسَنَاتِ يُذْهِبْنَ السَّيِّئَاتِ‏}‏‏.‏ فَقَالَ الرَّجُلُ يَا رَسُولَ اللَّهِ أَلِي هَذَا قَالَ ‏

‏ لِجَمِيعِ أُمَّتِي كُلِّهِمْ ‏

‏‏.‏

References2 variants
In-Book Reference
Book 9, Hadith 5
USC-MSA web (English) reference
Vol. 1, Book 10, Hadith 504 (deprecated numbering scheme)
Sharh · explanationclick to expand
One of the means that help a person to repent is being keen to increase the number of righteous deeds that he does, so that most of his time will be spent in worshipping Allah and his heart will always be thinking of doing righteous deeds. One of these means of expiating sin is prayer. In this hadith, ‘Abdullah ibn Mas‘ud (may Allah be pleased with him) narrates that a man kissed a woman who was not permissible for him. Then he came to the Prophet (blessings and peace of Allah be upon him) and told him what had happened. Then Allah revealed this verse: {And establish prayer at the two ends of the day} [Hud 11:114]. That is, establish the obligatory prayers at the beginning and end of the day, namely Fajr, Zuhr and ‘Asr; {and in some hours of the night} that is, and establish prayer during the night hours, namely Maghrib and ‘Isha’; {Indeed, good deeds do away with misdeeds} – righteous deeds, such as prayer and other actions, expiate minor sins. The man asked the Prophet (blessings and peace of Allah be upon him): O Messenger of Allah, is this ruling for me alone? The Prophet (blessings and peace of Allah be upon him) said: “It is for all of my ummah.” This was affirmation after affirmation from the Prophet (blessings and peace of Allah be upon him) that this included both those who were present and those who were absent. In other words, it is for them, and you are one of them. This expiation is only for minor sins. In the case of major sins, complete repentance is required, fulfilling all the necessary conditions. This hadith highlights the extent of Allah’s mercy to His slaves, and that He accepts the repentance of those who repent..
Related hadiths6
Compare isnād across 6 related chains →