Sahih al-Bukhari, Book 86, Hadith 46 (Bukhari 6571)

Narrated Abu Huraira:

The Prophet (ﷺ) said, "The boy is for (the owner of) the bed and the stone is for the person who commits illegal sexual intercourse.'