Abdullah bin Amr bin As reported,

A man stood up and said, "Messenger of Allah, so-and-so is my son. I committed fornication with his mother during the days of ignorance."The Messenger of Allah ﷺ replied, "There is no claim of paternity through fornication in Islam. The practices of the days of ignorance are gone. The child belongs to the marriage bed, and the fornicator gets the stone."

Azami 6269

Hasan

عن عمرو بن شعيب، عن أبيه، عن جده قال

قام رجل فقال: يا رسول الله! إن فلانا ابني، قد عاهرت بأمه في الجاهلية. فقال رسول الله ﷺ: لا دعوة في الإسلام، ذهب أمر الجاهلية، الولد للفراش، وللعاهر الحجر.

الأعظمي 6269حسن
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Marriage
Chapter
Marriage and its conditions
Section
Attributing the child to the marriage bed if its owner does not disown him
Numbering
Jami al-Kamil 6269 (2nd edition)
Azami 6269