Sunan Ibn Majah, Book 5, Hadith 524 (Ibn Majah 1326)

It was narrated that Abu Hurairah said:

“The Messenger of Allah (ﷺ) said: ‘Whoever fasts Ramadan and spends its nights in prayer, out of faith and in hope of reward, his previous sins will be forgiven.’”