Mishkat al-Masabih
Mishkat al-Masabih 567
وَعَنْ أَنَسٍ قَالَ: جَاءَ رَجُلٌ فَقَالَ يَا رَسُولَ اللَّهِ إِنِّي أَصَبْتُ حَدًّا فأقمه عَليّ قَالَ وَلم يسْأَله عَنهُ قَالَ وَحَضَرَتِ الصَّلَاةُ فَصَلَّى مَعَ رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فَلَمَّا قَضَى النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ الصَّلَاة قَامَ إِلَيْهِ الرَّجُلُ فَقَالَ يَا رَسُولَ اللَّهِ إِنِّي أَصَبْتُ حَدًّا فأقم فِي كتاب الله قَالَ أَلَيْسَ قَدْ صَلَّيْتَ مَعَنَا قَالَ نَعَمْ قَالَ فَإِنَّ اللَّهَ قَدْ غَفَرَ لَكَ ذَنْبَكَ أَو قَالَ حدك "
Anas reported that a man came and said, ‘Messenger of Allah, I have committed an offense carrying a prescribed penalty, so impose it on me.’ The Prophet did not ask him what he had done. When prayer time came, the man prayed with the Messenger of Allah. After the Prophet finished the prayer, the man stood and said, ‘Messenger of Allah, I have committed an offense carrying a prescribed penalty, so impose on me the penalty prescribed in Allah’s Book.’ He asked, ‘Did you not pray with us?’ The man replied, ‘Yes.’ He said, ‘Allah has forgiven your sin’—or he said, ‘your prescribed penalty.’ (Agreed upon.)