Imran bin Husayn reported,

A woman from the tribe of Juhaynah came to the Prophet of Allah ﷺ while pregnant from adultery and said, "Prophet of Allah, I have committed an offense deserving the prescribed punishment, so carry it out on me."The Prophet ﷺ summoned her guardian and said, "Treat her well, and when she gives birth, bring her to me." The man did so.Then the Prophet of Allah ﷺ gave the order, and her clothes were tied securely around her. He commanded that she be stoned, and it was carried out. Afterwards, he prayed the funeral prayer over her.Umar said to him, "Are you praying over her, Prophet of Allah, when she has committed adultery?"He replied, "She has made such a sincere repentance that if it were divided among seventy of the people of Madinah, it would be enough for them all. Have you found any repentance better than her giving up her own life for the sake of Allah the Exalted?"

Azami 3739

Sahih

عن عمران بن حصين

أن امرأة من جهينة أتت نبي الله ﷺ وهي حبلى من الزنا، فقالت: يا نبي الله! أصبت حدا فأقمه علي، فدعا النبي ﷺ وليها فقال: أحسن إليها، فإذا وضعت فائتني بها ففعل. فأمر بها نبي الله ﷺ فشكت عليها ثيابها، ثم أمر بها فرجمت، ثم صلى عليها، فقال له عمر: تصلي عليها يا نبي الله! وقد زنت فقال: لقد تابت توبة لو قسمت بين سبعين من أهل المدينة لوسعتهم، وهل وجدت توبة أفضل من أن جادت بنفسها الله تعالى.

الأعظمي 3739صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Funerals
Chapter
Prayer over the deceased
Section
Permissibility of praying over the one who was stoned
Numbering
Jami al-Kamil 3739 (2nd edition)
Azami 3739