Riyad as-Salihin #435 · The Book of Miscellany

Riyad as-SalihinAnas ibn Malik
Riyad as-Salihin · Book 1 · The Book of Miscellany
Riyad as-Salihin · كتاب 1 · كتاب المقدمات
A man came to the Prophet (صلى الله عليه وسلم) and said, "O Messenger of Allah, I have committed a sin liable of ordained punishment. So execute punishment on me". Messenger of Allah (صلى الله عليه وسلم) did not ask him about it, and then came the (time for) Salat (prayers). So he performed Salat with Messenger of Allah (صلى الله عليه وسلم). When Messenger of Allah (صلى الله عليه وسلم) finished Salat, the man stood up and said: "O Messenger of Allah! I have committed a sin. So execute the Ordinance of Allah upon me". He (صلى الله عليه وسلم) asked, "Have you performed Salat with us?" "Yes", he replied. Messenger of Allah (صلى الله عليه وسلم) said, "Verily, Allah has forgiven you". [Al-Bukhari and Muslim] .
وعن أنس، رضي الله عنه ، قال: جاء رجل إلى النبي، صلى الله عليه وسلم فقال: يا رسول الله أصبت حداً، فأقمه علي، وحضرت الصلاة، فصلى مع رسول الله، صلى الله عليه وسلم، فلما قضى الصلاة قال : يارسول الله إنى أصبت حداً، فأقم في كتاب الله. قال “هل حضرت معنا الصلاة؟
" قال: نعم . قال: قد غفر لك" ((متفق عليه)). ('وقوله اصبت حداً معناه : معصية توجب التعزير، وليس المراد الحد الشرعي الحقيقى كحد الزنا والخمر وغيرهما، فإن هذه الحدود لا تسقط بالصلاة، ولا يجوز للإمام تركها')
Reference : Riyad as-Salihin 435In-book reference : Book 1, Hadith 435