Sahih al-Bukhari 2153, 2154
Narrated Abu Huraira and Zaid bin Khalid:
Allah's Messenger (ﷺ) was asked about the slave-girl, if she was a virgin and committed illegal sexual 
intercourse. The Prophet (ﷺ) said, "If she committed illegal sexual intercourse, lash her, and if she did it a 
second time, then lash her again, and if she repeated the third time, then sell her even for a hair rope." 
Ibn Shihab said, "I don't know whether to sell her after the third or fourth offense."
حَدَّثَنَا إِسْمَاعِيلُ، قَالَ حَدَّثَنِي مَالِكٌ، عَنِ ابْنِ شِهَابٍ، عَنْ عُبَيْدِ اللَّهِ بْنِ عَبْدِ اللَّهِ، عَنْ أَبِي هُرَيْرَةَ، وَزَيْدِ بْنِ خَالِدٍ ـ رضى الله عنهما ـ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم سُئِلَ عَنِ الأَمَةِ إِذَا زَنَتْ وَلَمْ تُحْصِنْ قَالَ ‏
"‏ إِنْ زَنَتْ فَاجْلِدُوهَا، ثُمَّ إِنْ زَنَتْ فَاجْلِدُوهَا، ثُمَّ إِنْ زَنَتْ فَبِيعُوهَا وَلَوْ بِضَفِيرٍ ‏"‏‏.‏ قَالَ ابْنُ شِهَابٍ لاَ أَدْرِي بَعْدَ الثَّالِثَةِ، أَوِ الرَّابِعَةِ‏.‏