Sunan an-Nasa'i, Volume 3, Book 21, Hadith 1959 (DarusSalam) ⓘ
It was narrated from "Imran bin Husain that: a woman from Juhainah came to the Messenger of Allah sand said: "I have committed Zina." And she was committed Zina." And She was pregnant. He handed her over to her guardian and said: "Look after her, and when she gave birth, he brought her to him. He ordered that her garment be wrapped around her, then he offered the funeral prayer for her. 'Umar said to him: "Are you praying for her even though she committed Zina?" he said: "She has repented in a manner that, if it were to be shared among seventy of the people of Al-Madinah it would suffice them. Have you ever seen repentance better than the one who sacrificed herself for the sake of Allah, the Mighty and Sublime?"
أَخْبَرَنَا إِسْمَاعِيلُ بْنُ مَسْعُودٍ، قَالَ حَدَّثَنَا خَالِدٌ، قَالَ حَدَّثَنَا هِشَامٌ، عَنْ يَحْيَى بْنِ أَبِي كَثِيرٍ، عَنْ أَبِي قِلاَبَةَ، عَنْ أَبِي الْمُهَلَّبِ، عَنْ عِمْرَانَ بْنِ حُصَيْنٍ، أَنَّ امْرَأَةً، مِنْ جُهَيْنَةَ أَتَتْ رَسُولَ اللَّهِ صلى الله عليه وسلم فَقَالَتْ إِنِّي زَنَيْتُ وَهِيَ حُبْلَى فَدَفَعَهَا إِلَى وَلِيِّهَا فَقَالَ " أَحْسِنْ إِلَيْهَا فَإِذَا وَضَعَتْ فَائْتِنِي بِهَا " . فَلَمَّا وَضَعَتْ جَاءَ بِهَا فَأَمَرَ بِهَا فَشُكَّتْ عَلَيْهَا ثِيَابُهَا ثُمَّ رَجَمَهَا ثُمَّ صَلَّى عَلَيْهَا فَقَالَ لَهُ عُمَرُ أَتُصَلِّي عَلَيْهَا وَقَدْ زَنَتْ فَقَالَ " لَقَدْ تَابَتْ تَوْبَةً لَوْ قُسِمَتْ بَيْنَ سَبْعِينَ مِنْ أَهْلِ الْمَدِينَةِ لَوَسِعَتْهُمْ وَهَلْ وَجَدْتَ تَوْبَةً أَفْضَلَ مِنْ أَنْ جَادَتْ بِنَفْسِهَا لِلَّهِ عَزَّ وَجَلَّ " .
also referenced under: Hadith 1957 (Reference) & Book 21, Hadith 141 (In-Book)