Narrated Zaid bin Khalid and Abu Huraira
that Allah's Messenger (ﷺ) was asked about an unmarried slave-girl who committed illegal sexual intercourse. They heard him saying, "Flog her, and if she commits illegal sexual intercourse after that, flog her again, and on the third (or the fourth) offense, sell her."