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, that you will not commit adultery, that you will not steal, and that you will not kill a soul whom Allah has forbidden to be killed except by right. Whoever among you fulfills this, his reward is with Allah. Whoever commits any of these offenses and is punished for it, that punishment is an expiation for him. And whoever commits any of these offenses and Allah conceals it for him, his affair is left to Allah. If He wishes, He will pardon him, and if He wishes, He will punish him."

Azami 6916

Sahih

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

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

الأعظمي 6916صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Legal punishments
Chapter
Hudud in general
Section
Prescribed punishments are expiation
Numbering
Jami al-Kamil 6916 (2nd edition)
Azami 6916