Sahih Bukhari Volume 3, Book 34, Hadith Number 435.

Narated By Zaid bin Khalid and Abu Huraira : That Allah’s Apostle 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.”