Sunnah.com reference : Book 8, Hadith 187English translation : Book 8, Hadith 1134Arabic reference : Book 8, Hadith 1123
Narrated Abu Hurairah (RA):
The Prophet (ﷺ) said: "The child (born out of wedlock) belongs to the one on whose bed it is born, and stoning to death is for the fornicator."

[Agreed upon, regarding Abu Hurairah's Hadith].
وَعَنْ أَبِي هُرَيْرَةَ ‏- رضى الله عنه ‏- عَنْ اَلنَّبِيِّ ‏- صلى الله عليه وسلم ‏-قَالَ: { اَلْوَلَدُ لِلْفِرَاشِ, وَلِلْعَاهِرِ اَلْحَجَرُ.‏ }  مُتَّفَقٌ عَلَيْهِ مِنْ حَدِيثِهِ  1‏ .‏‏1 ‏- صحيح.‏ رواه البخاري (6818)‏، ومسلم (1458)‏.‏