The Prophet ﷺ said, "The child belongs to the bed, and for the fornicator is the stone."
حدثنا سفيان عن الزهري عن سعيد
أن النبي ﷺ قال الولد للفراش وللعاهر الحجر
Its chain of transmission is sahih. It was reported by the group except Abu Dawud, as in al-Muntaqa 3788, and Fath Kabir 3:308. Its meaning has already appeared repeatedly within hadiths 173, 416, 467, 20, 6681, 6933.