Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:17104Muḥammad b. ʿAbdullāh al-Ḥāfiẓ > Abū al-Faḍl b. Ibrāhīm > Aḥmad b. Salamah > Isḥāq b. Ibrāhīm > Yaḥyá b. Ādam > Isrāʾīl > al-Suddī > Saʿd b. ʿUbaydah > Abū ʿAbd al-Raḥman > Khaṭabanā ʿAlī

[Machine] "O people, whichever male or female slave commits adultery, then punish them with the specified punishment. And if they commit adultery, then flog them with the specified punishment. Then he said, indeed a servant of the Messenger of Allah ﷺ had a child from adultery, so he sent me to flog her. And I found her recently delivered and I feared that I would kill her. So he said, you have done well, leave her until she delivers her child."  

البيهقي:١٧١٠٤أَخْبَرَنَا مُحَمَّدُ بْنُ عَبْدِ اللهِ الْحَافِظُ أنبأ أَبُو الْفَضْلِ بْنُ إِبْرَاهِيمَ ثنا أَحْمَدُ بْنُ سَلَمَةَ ثنا إِسْحَاقُ بْنُ إِبْرَاهِيمَ ثنا يَحْيَى بْنُ آدَمَ ثنا إِسْرَائِيلُ عَنِ السُّدِّيِّ عَنْ سَعْدِ بْنِ عُبَيْدَةَ عَنْ أَبِي عَبْدِ الرَّحْمَنِ قَالَ خَطَبَنَا عَلِيٌّ ؓ فَقَالَ

أَيُّهَا النَّاسُ أَيُّمَا عَبْدٍ وَأَمَةٍ فَجَرَا فَأَقِيمُوا عَلَيْهِمَا الْحَدَّ وَإِنْ زَنَيَا فَاجْلُدُوهُمَا الْحَدَّ ثُمَّ قَالَ إِنَّ خَادِمًا لِرَسُولِ اللهِ ﷺ وَلَدَتْ مِنَ الزِّنَا فَبَعَثَنِي لِأَجْلِدَهَا فَوَجَدْتُهَا حَدِيثَةَ عَهْدٍ بِنِفَاسِهَا فَخَشِيتُ أَنْ أَقْتُلَهَا فَقَالَ أَحْسَنْتَ اتْرُكْهَا حَتَّى تَمَاثَلَ  

رَوَاهُ مُسْلِمٌ فِي الصَّحِيحِ عَنْ إِسْحَاقَ بْنِ إِبْرَاهِيمَ

See similar narrations below:

Collected by Bayhaqī
bayhaqi:17004Abū al-Qāsim ʿAbd al-Khāliq b. ʿAlī b. ʿAbd al-Khāliq al-Muʾadhhin > Abū Bakr Muḥammad b. Aḥmad b. Khanb al-Baghdādī Bibukhārā > al-Ḥasan b. Sallām al-Sawwāq > ʿUbaydullāh b. Mūsá > Isrāʾīl > al-Suddī > Saʿd b. ʿUbaydah > Abū ʿAbd al-Raḥman al-Sulamī > ʿAlī

[Machine] I heard Ali, while he was giving a sermon on the pulpit, praising and glorifying God. Then he said, "O people, if any male or female servant commits adultery, then establish the punishment upon them. And if they were previously married, then flog them. Indeed, a servant of the Messenger of Allah ﷺ committed adultery, so he sent me to strike her. But I found her recently postpartum and I feared that if I were to strike her, I would kill her. Therefore, I refrained from hitting her until she recovered and regained her strength." He (the narrator) said, "You have done well."  

البيهقي:١٧٠٠٤أَخْبَرَنَا أَبُو الْقَاسِمِ عَبْدُ الْخَالِقِ بْنُ عَلِيِّ بْنِ عَبْدِ الْخَالِقِ الْمُؤَذِّنُ أنبأ أَبُو بَكْرٍ مُحَمَّدُ بْنُ أَحْمَدَ بْنِ خَنْبٍ الْبَغْدَادِيُّ بِبُخَارَا ثنا الْحَسَنُ بْنُ سَلَّامٍ السَّوَّاقُ ثنا عُبَيْدُ اللهِ بْنُ مُوسَى أنبأ إِسْرَائِيلُ عَنِ السُّدِّيِّ عَنْ سَعْدِ بْنِ عُبَيْدَةَ عَنْ أَبِي عَبْدِ الرَّحْمَنِ السُّلَمِيِّ قَالَ

سَمِعْتُ عَلِيًّا ؓ وَهُوَ يَخْطُبُ عَلَى الْمِنْبَرِ فَحَمِدَ اللهَ وَأَثْنَى عَلَيْهِ ثُمَّ قَالَ أَيُّهَا النَّاسُ أَيُّمَا عَبْدٍ أَوْ أَمَةٍ زَنَى فَأَقِيمُوا عَلَيْهِ الْحَدَّ وَإِنْ كَانَ قَدْ أُحْصِنَ فَاجْلِدُوهُ فَإِنَّ خَادِمًا لِرَسُولِ اللهِ ﷺ زَنَتْ فَأَرْسَلَنِي إِلَيْهَا لِأَضْرِبَهَا فَوَجَدْتُهَا حَدِيثَةَ عَهْدٍ بِنِفَاسِهَا وَخَشِيتُ إِنْ أَنَا ضَرَبْتُهَا أَنْ أَقْتُلَهَا فَرَدَدْتُ عَنْهَا حَتَّى تُمَاثِلَ وَتَشْتَدَّ قَالَ أَحْسَنْتَ  

أَخْرَجَهُ مُسْلِمٌ فِي الصَّحِيحِ مِنْ حَدِيثِ إِسْرَائِيلَ