Sayyiduna Wathilah bin al-Asqa' (may Allah be pleased with him) narrates: We were with the Prophet (peace and blessings be upon him) when a man came and said: "O Messenger of Allah, I have committed one of the hadd offences of Allah, so carry out Allah's hadd (prescribed punishment) on me." He (peace and blessings be upon him) turned away from him. He came a second time, and he (peace and blessings be upon him) turned away again; then he came a third time, and he (peace and blessings be upon him) turned away again. Meanwhile the iqamah for the prayer was called. When the Prophet (peace and blessings be upon him) had finished the prayer, he said: "O Messenger of Allah, I have committed one of the hadd offences of Allah, so carry out Allah's hadd on me." He (peace and blessings be upon him) said: "Did you not perform ablution and perform it well, and purify yourself and purify yourself well, and attend the prayer with us just now?" He said: "Yes." He (peace and blessings be upon him) said: "Go, this is your expiation."
Hadith Referenceالمعجم الكبير للطبراني / باب الواو / 18411