Maez bin Malik al-Aslami came to the Messenger of Allah ﷺ and said, "Messenger of Allah, I have wronged myself and committed adultery, and I want you to purify me."He turned him away.The next day, he came to him again and said, "Messenger of Allah, I have committed adultery."He turned him away a second time. Then the Messenger of Allah ﷺ sent word to his people and asked, "Do you know of any defect in his mind? Do you find anything wrong with him?"They replied, "We know him only as one of sound mind, among the best of us, as far as we can see."He came to him a third time, and he again sent word to them and asked about him, and they informed him that there was nothing wrong with him or his mind. When he came the fourth time, a pit was dug for him, then the Prophet ordered that he be stoned, and he was stoned. The hadith continues.
أن ماعز بن مالك الأسلمي أتى رسول الله ﷺ فقال: يا رسول الله، إني قد ظلمت نفسي وزنيت، وإني أريد أن تطهر ني، فرده، فلما كان من الغد أتاه فقال: يا رسول الله إني قد زنيت فرده الثانية. فأرسل رسول الله ﷺ إلى قومه فقال: أتعلمون بعقله بأسا تنكرون منه شيئا؟ فقالوا: ما نعلمه إلا وفي العقل من صالحينا فيما نرى. فأتاه الثالثة، فأرسل إليهم أيضا فسألوه عنه فأخبروه: أنه لا بأس به ولا بعقله. فلما كان الرابعة حفر له حفرة ثم أمر به فرجم… الحديث.