Sayyiduna Ubadah bin al-Samit (may Allah be pleased with him) narrates: Among the judgements of the Prophet (peace and blessings be upon him) is also this: that the child belongs to the owner of the bed, and for the fornicator there is deprivation.
Tabarani and Ahmad recorded it within a long hadith, and its chain is munqati' (broken).
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الطلاق / 7858