A woman from Juhayna confessed to the Prophet ﷺ that she had committed adultery, saying, "I am pregnant."The Prophet ﷺ called her guardian and said, "Treat her well, and when she gives birth, inform me." The man did so.Then the Prophet ﷺ gave the order, and her clothes were tied firmly around her. He commanded that she be stoned, and she was stoned. Afterwards, he prayed over her.Umar bin Khattab said to him, "Messenger of Allah, you prayed over her after stoning her?"He replied, "She has repented with such a repentance that, were it divided among seventy of the people of Madinah, it would suffice them all. Have you found anything better than that she gave her own life for the sake of Allah?"
حدثنا الحسن بن علي حدثنا عبد الرزاق حدثنا معمر عن يحيى بن أبي كثير عن أبي قلابة عن أبي المهلب
أن امرأة من جهينة اعترفت عند النبي ﷺ بالزنا فقالت إني حبلى فدعا النبي ﷺ وليها فقال أحسن إليها فإذا وضعت حملها فأخبرني ففعل فأمر بها فشدت عليها ثيابها ثم أمر برجمها فرجمت ثم صلى عليها فقال له عمر بن الخطاب يا رسول الله رجمتها ثم تصلي عليها فقال لقد تابت توبة لو قسمت بين سبعين من أهل المدينة لوسعتهم وهل وجدت شيئا أفضل من أن جادت بنفسها لله
Muslim also narrated it, in the Book of Legal Punishments, chapter on one who confesses against himself to fornication, hadith no. 1696, from the hadith of Yahya bin Abu Kathir with the same chain.