It is narrated from Sayyiduna Wathilah (may Allah be pleased with him) that a man came to the Prophet (peace and blessings be upon him) and said: "O Messenger of Allah, I have committed something that carries a hadd (prescribed punishment), so carry it out on me." He (peace and blessings be upon him) paid no attention to him twice; then the prayer was started. When he (peace and blessings be upon him) had concluded with the salam, he said: "O Messenger of Allah, I have committed something that carries a hadd, so carry it out on me." The Messenger of Allah (peace and blessings be upon him) said to him: "Did you not perform ablution when you came?" He said: "Yes." He (peace and blessings be upon him) said: "And you prayed with us?" He said: "Yes." He (peace and blessings be upon him) said: "Then go, for Allah has forgiven you."
Hadith Referenceالمعجم الكبير للطبراني / باب الواو / 18382