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. But she had only recently given birth, and I feared that if I flogged her I would kill her. So I mentioned this to the Prophet ﷺ, and he said, 'You did well.'"In another version he did not mention "both those who are married and those who are not," and added to the report the words, "Leave her until she recovers."

Muslim 4451

Sahih

و حدثناه إسحق بن إبراهيم أخبرنا يحيى بن آدم حدثنا إسرائيل عن السدي بهذا الإسناد ولم يذكر من أحصن منهم ومن لم يحصن وزاد في الحديث اتركها حتى تماثل

مسلم 4451صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Legal punishments
Chapter
Delaying the hadd punishment for the woman in postpartum bleeding
Numbering
Darussalam 4451
Muslim 4451