Sahih al-Bukhari 2555
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
إِذَا زَنَتِ الأَمَةُ فَاجْلِدُوهَا، ثُمَّ إِذَا زَنَتْ فَاجْلِدُوهَا، ثُمَّ إِذَا زَنَتْ فَاجْلِدُوهَا، فِي الثَّالِثَةِ أَوِ الرَّابِعَةِ بِيعُوهَا وَلَوْ بِضَفِيرٍ "
Narrated Abu Huraira and Zaid bin Khalid:
The Prophet (ﷺ) said, "If a slave-girl (Ama) commits illegal sexual intercourse, scourge her; if she does it again, scourge her again; if she repeats it, scourge her again." The narrator added that on the third or the fourth offense, the Prophet (ﷺ) said, "Sell her even for a hair rope."
Full reference and source
Sahih al-Bukhari 2555 In-book : Book 49, Hadith 39 USC-MSA web (English) : Vol. 3, Book 46, Hadith 731 (deprecated)
View source on Sunnah.com (opens in a new tab)