It is narrated from Sayyiduna Zayd bin Khalid al-Juhani and Abu Hurayrah (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) was asked about a slave woman who is unmarried and commits adultery, and he (peace and blessings be upon him) said: "When she commits adultery, flog her; then if she commits adultery, flog her; then if she commits adultery, flog her; then sell her, even if for a rope of hair." Ibn Shihab said: "I do not remember whether it was after the third time or the fourth, and dafir means a rope."
Hadith Referenceالمعجم الكبير للطبراني / باب الزاي / 5183