Sayyiduna Imran bin Husayn (may Allah be pleased with him) said: A woman from the tribe of Juhaynah came to the Prophet (peace and blessings be upon him), and she was pregnant from adultery. The Prophet (peace and blessings be upon him) said to her guardian: "Treat her well, and when she has delivered, bring her." He did so. Then, when she came again, he (peace and blessings be upon him) ordered that she be stoned, and then he (peace and blessings be upon him) also offered the funeral prayer over her. Sayyiduna Umar (may Allah be pleased with him) said: O Messenger of Allah (peace and blessings be upon him), she committed adultery and you are praying over her? He (peace and blessings be upon him) said: "She has repented with such a repentance that, if it were divided among all the people of Madinah, it would suffice them. Have you seen anything better than that she offered up her own self for Allah Almighty?" [Sahih]
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الحدود / 16951