Abu Huraira reported God's messenger as saying, "He who fasts during Ramadan with faith and seeking his reward from God will have his past sins forgiven; he who prays during the night in Ramadan with faith and seeking his reward from God will have his past sins forgiven; and he who passes Lailat al-qadr [Night of Decree] in prayer with faith and seeking his reward from God will have his past sins forgiven."
(Bukhari and Muslim.)