Sunan Abi Dawud 2274
Grading supplied with this record: Hasan Sahih (Al-Albani)
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
لاَ دِعْوَةَ فِي الإِسْلاَمِ ذَهَبَ أَمْرُ الْجَاهِلِيَّةِ الْوَلَدُ لِلْفِرَاشِ وَلِلْعَاهِرِ الْحَجَرُ "
Amr b. Shu'aib on his father's authority said that his grandfather reported:
A man got up and said: Messenger of Allah, so-and-so is my son; I had illicit intercourse with his mother in the pre-Islamic period. The Messenger of Allah (ﷺ) said: There is no unlawful claiming of paternity in Islam. What was done in pre-Islamic times has been annulled. The child is attributed to the one on whose bed it is born, and the fornicator is deprived of any right.
Full reference and source
Sunan Abi Dawud 2274 In-book : Book 13, Hadith 100 English translation : Book 12, Hadith 2267
View source on Sunnah.com (opens in a new tab)