Abu Abdul-Rahman reported,

Ali delivered a sermon and said, "People, carry out the prescribed punishment on your slaves, both those who are married and those who are not. A slave-girl belonging to the Messenger of Allah ﷺ committed fornication, and he ordered me to flog her. When I went to her, I found that she had recently given birth, and I feared that if I flogged her I would kill her. I mentioned this to the Prophet ﷺ, and he said, 'You did well.'"

Azami 6962

Sahih

عن أبي عبد الرحمن قال

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

الأعظمي 6962صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Legal punishments
Chapter
Hadd of zina
Section
Master establishing the legal punishment on his slave by order of the ruler
Numbering
Jami al-Kamil 6962 (2nd edition)
Azami 6962