A man from Aslam came to the Prophet ﷺ and confessed to adultery. The Prophet ﷺ turned away from him. Then he confessed again, and the Prophet ﷺ turned away from him, until he had testified against himself four times.The Prophet ﷺ asked, "Are you insane?"He replied, "No."The Prophet ﷺ asked, "Have you been married?"He replied, "Yes."So the Prophet ﷺ gave the order, and he was stoned at the prayer ground. When the stones struck him painfully, he fled, but he was caught and stoned until he died. The Messenger of Allah ﷺ spoke well of him, but did not pray over him.
حدثنا بذلك الحسن بن علي حدثنا عبد الرزاق أنبأنا معمر عن الزهري عن أبي سلمة بن عبد الرحمن
أن رجلا من أسلم جاء إلى النبي ﷺ فاعترف بالزنا فأعرض عنه ثم اعترف فأعرض عنه حتى شهد على نفسه أربع شهادات فقال النبي ﷺ أبك جنون قال لا قال أحصنت قال نعم قال فأمر به فرجم بالمصلى فلما أذلقته الحجارة فر فأدرك فرجم حتى مات فقال له رسول الله ﷺ خيرا ولم يصل عليه
Agreed upon (by Bukhari and Muslim). Bukhari narrated it in the Book of Legal Punishments, chapter on stoning at the place of prayer, no. 6820, and Muslim, no. 1691, both from the hadith of Abdul-Razzaq, with the same wording.