Sahih al-Bukhari 18
ʿUbādah ibn al-Ṣāmit (r.a), who took part in [the battle of] Badr and was one of the leaders on the night of al-ʿAqabah, narrated that the Messenger of Allāh (saw) said whilst surrounded by a group of his Companions: ‘Pledge to me that you will not associate any partners with Allāh, will not steal, will not commit adultery or fornication, will not kill your children, will not make false accusations which you yourselves have deliberately forged and will not disobey in that which is good. Whoever of you fulfils [this pledge] will be rewarded by Allāh. Whoever commits any of these sins and is then punished in this world, his punishment will serve as an expiation for him. Whoever commits any of these sins and Allāh covers it, it is up to Allāh to forgive him if He so chooses, or to punish him if He so chooses.’ We pledged to him accordingly.
Translation: Ahmadiyya Muslim Jamaat