Sunan an-Nasa'i, Book 22, Hadith 115 (Nasa'i 2209)

It was narrated that Abu Hurairah said:

"The Messenger of Allah said: 'Whoever fasts Ramadan out of faith and in the hope of reward, he will be forgiven his previous sins."'