Sunan an-Nasa'i, Book 22, Hadith 116 (Nasa'i 2210)

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." '