It is narrated from Sayyiduna Khuzaymah bin Thabit (may Allah be pleased with him) that he said: "Whoever commits a sin and the prescribed punishment (hadd) for that sin is carried out on him, that is its expiation."
Hadith Referenceالمعجم الكبير للطبراني / باب الخاء / 3713