The Book Pertaining to Repentance and Exhortation to Repentance (Kitab Al-Tauba)
Muslim :: Book 37 : Hadith 6660
Anas reported that a person came to Allah's Apostle (may peace be upon him) said: Allah's Messenger, I have committed an offence which deserves imposition of haad, so impose it upon me according to the Book of Allah. Thereupon he said: Were you not present with us at the time of prayer? He said: Yes. Thereupon he said: You have been granted pardon.