Abu Umama reported:
We were sitting in the mosque in the company of Allah's Messenger ( صلی اللہ علیہ وسلم ). A person came there and said: Allah's Messenger, I have committed an offence which deserves the imposition of hadd upon me, so impose it upon me. Allah's Messenger ( صلی اللہ علیہ وسلم ) kept silent. He repeated it and said: Allah's Messenger, I have committed an offence which deserves the imposition of hadd upon me, so impose it upon me. He (the Holy Prophet) kept silent, and it was at this time that Iqama was pronounced for prayer (and the prayer was observed). And when Allah's Apostle ( صلی اللہ علیہ وسلم ) had concluded the payer that person followed Allah's Messenger ( صلی اللہ علیہ وسلم ). Abu Umama said: I too followed Allah's Messenger ( صلی اللہ علیہ وسلم ) after he had concluded the prayer, so that I should know what answer he would give to that person. That person remained attached to Allah's Messenger ( صلی اللہ علیہ وسلم ) and said: Allah's Messenger, I have committed an offence which deserves imposition of hadd upon me, so impose it upon me. Abu Umama reported that Allah's Messenger ( صلی اللہ علیہ وسلم ) said to him: Didn't you see that as you got out of the house, you performed ablution perfectly well. He said: Allah's Messenger, of course. I did it. He again said to him: Then you observed prayer along with us. He said: Allah's Messenger, yes, it is so. Thereupon Allah's Messenger ( صلی اللہ علیہ وسلم ) said to him: Verily, Allah has exempted you from the imposition of hadd, or he said. From your sin.