Muwatta Imam Malik Book of Hudud, Hadith 14
Malik related to me from Ibn Shihab from Ubaydullah ibn Abdullah ibn Utba ibn Masud from Abu Hurayra and Zayd ibn Khalid al-Juhani that the Messenger of Allah ﷺ was asked about a slave-girl who committed fornication and was not muhsana. He said, "If she commits fornication, then flog her. If she commits fornication again, then flog her, and if she commits fornication again, then sell her, if only for a rope."
Ibn Shihab added, "I don't know whether it was three or four times."
حَدَّثَنِي مَالِكٌ، عَنِ ابْنِ شِهَابٍ، عَنْ عُبَيْدِ اللَّهِ بْنِ عَبْدِ اللَّهِ بْنِ عُتْبَةَ بْنِ مَسْعُودٍ، عَنْ أَبِي هُرَيْرَةَ، وَزَيْدِ بْنِ خَالِدٍ الْجُهَنِيِّ، أَنَّ رَسُولَ اللَّهِ ﷺ سُئِلَ عَنِ الأَمَةِ إِذَا زَنَتْ وَلَمْ تُحْصِنْ فَقَالَ " إِنْ زَنَتْ فَاجْلِدُوهَا ثُمَّ إِنْ زَنَتْ فَاجْلِدُوهَا ثُمَّ إِنْ زَنَتْ فَاجْلِدُوهَا ثُمَّ بِيعُوهَا وَلَوْ بِضَفِيرٍ " . قَالَ ابْنُ شِهَابٍ لاَ أَدْرِي أَبَعْدَ الثَّالِثَةِ أَوِ الرَّابِعَةِ .