Hadith 2014

Narrated Abu Huraira:

The Prophet said, "Whoever fasted the month of Ramadan out of sincere Faith (i.e. belief) and hoping for a reward from Allah, then all his past sins will be forgiven, and whoever stood for the prayers in the night of Qadr out of sincere Faith and hoping for a reward from Allah, then all his previous sins will be forgiven ."

حَدَّثَنَا عَلِيُّ بْنُ عَبْدِ اللَّهِ، حَدَّثَنَا سُفْيَانُ، قَالَ حَفِظْنَاهُ وَإِنَّمَا حَفِظَ مِنَ الزُّهْرِيِّ عَنْ أَبِي سَلَمَةَ عَنْ أَبِي هُرَيْرَةَ ـ رضى الله عنه ـ عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏"‏ مَنْ صَامَ رَمَضَانَ إِيمَانًا وَاحْتِسَابًا غُفِرَ لَهُ مَا تَقَدَّمَ مِنْ ذَنْبِهِ، وَمَنْ قَامَ لَيْلَةَ الْقَدْرِ إِيمَانًا وَاحْتِسَابًا غُفِرَ لَهُ مَا تَقَدَّمَ مِنْ ذَنْبِهِ ‏"‏‏.‏ تَابَعَهُ سُلَيْمَانُ بْنُ كَثِيرٍ عَنِ الزُّهْرِيِّ‏.‏

Reference: 119290
In-book reference: Book 32, Hadith 2014
Hadith 2014 - Virtues of the Night of Qadr - Sahih al-Bukhari - Sunnah.com