Sayyiduna Abu Hurayrah (may Allah be pleased with him) heard the Prophet (peace and blessings be upon him) saying: "The child belongs to the owner of the bed, and for the fornicator there is the stone."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب اللعان / 15370