A woman from the tribe of Juhaynah confessed to the Prophet ﷺ that she had committed adultery, saying, "I am pregnant."The Prophet ﷺ called her guardian and said to him, "Treat her kindly, and when she gives birth, inform me."The man did so. The Prophet ﷺ then gave orders concerning her, and her garments were tied securely around her. He commanded that she be stoned, and she was stoned. Then he prayed over her.Umar bin Khattab said, "Messenger of Allah, you stoned her and now you pray over her?"He replied, "She has made such a sincere repentance that if it were divided among seventy people of Madinah, it would be enough for them all. Have you ever found anything better than that she gave her own life for Allah ?"
حدثنا عبد الرزاق أخبرنا معمر عن يحيى بن أبي كثير عن أبي قلابة عن أبي المهلب
أن امرأة من جهينة اعترفت عند النبي ﷺ بزنا وقالت أنا حبلى فدعا النبي ﷺ وليها فقال أحسن إليها فإذا وضعت فأخبرني ففعل فأمر بها النبي ﷺ فشكت عليها ثيابها ثم أمر برجمها فرجمت ثم صلى عليها فقال عمر بن الخطاب يا رسول الله رجمتها ثم تصلي عليها فقال لقد تابت توبة لو قسمت بين سبعين من أهل المدينة لوسعتهم وهل وجدت شيئا أفضل من أن جادت بنفسها لله تبارك وتعالى
Its isnad is sahih. Abu Dawud narrated it (4/151, no. 4440), Tirmidhi (4/42, no. 1435), who said, hasan sahih, Nasai (4/63, no. 1957), Darimi (2/235, no. 2325), and Ibn Majah (2/854, no. 2555), all of them in the chapters on legal punishments except Nasai, who included it in the chapters on funerals.