Ubada bin Samit reported,

We were with the Messenger of Allah ﷺ in a gathering when he said, "Pledge allegiance to me that you will not associate anything with Allah, will not commit fornication, will not steal, and will not kill the soul that Allah has forbidden except by right. Whoever among you fulfills this, his reward is with Allah. Whoever commits any of these and is punished for it, that punishment is an expiation for him. And whoever commits any of these and Allah conceals it for him, his affair is left to Allah. If He wills, He will pardon him, and if He wills, He will punish him."

Muslim 4461

Sahih

حدثنا يحيى بن يحيى التميمي وأبو بكر بن أبي شيبة وعمرو الناقد وإسحق بن إبراهيم وابن نمير كلهم عن ابن عيينة واللفظ لعمرو قال حدثنا سفيان بن عيينة عن الزهري عن أبي إدريس

عن عبادة بن الصامت قال

كنا مع رسول الله ﷺ في مجلس فقال تبايعوني على أن لا تشركوا بالله شيئا ولا تزنوا ولا تسرقوا ولا تقتلوا النفس التي حرم الله إلا بالحق فمن وفى منكم فأجره على الله ومن أصاب شيئا من ذلك فعوقب به فهو كفارة له ومن أصاب شيئا من ذلك فستره الله عليه فأمره إلى الله إن شاء عفا عنه وإن شاء عذبه

مسلم 4461صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Legal punishments
Chapter
Hadd punishments are expiation for those who receive them
Numbering
Darussalam 4461
Muslim 4461