Jami` at-Tirmidhi, Book 9, Hadith 3 (Tirmidhi 811)

Abu Hurairah narrated that :

The Messenger of Allah said: "Whoever performs Hajj for Allah, and he does not have sexual relations nor commit any sin, then his previous sins will be forgiven."