Abu Abd al-Rahman al-Sulami (may Allah have mercy on him) said that Ali (may Allah be pleased with him) delivered a sermon and said: "O people, if your slaves commit fornication, establish the prescribed punishments on them in every case. The Prophet (peace and blessings be upon him) had a slave-girl who committed fornication, and he (peace and blessings be upon him) ordered me to flog her. When I went to flog her, she was in post-childbirth bleeding (nifas), so I thought that if I flogged her in this state she would die. I went and told him (peace and blessings be upon him) the whole matter, and he (peace and blessings be upon him) praised me."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب النفقات / 15803