The Prophet ﷺ ruled regarding any child whose paternity is claimed after the death of the father to whom he is attributed, when the father's heirs claim him. He ruled that if the child was born to a free woman whom the father had married, or to a slave woman whom he owned, then the child is attached to the one who claimed him. But if the child was born to a free woman or a slave woman with whom he had committed fornication, then the child is not attached to the one who claimed him. And if the father to whom he is attributed had himself claimed him, while the child was born of fornication, then the child belongs to his mother's people, whoever they may be, free or slave.
حدثنا يزيد أخبرنا محمد بن راشد عن سليمان بن موسى
أن النبي ﷺ قضى أيما مستلحق استلحق بعد أبيه الذي يدعى له ادعاه ورثته قضى إن كان من حرة تزوجها أو من أمة يملكها فقد لحق بما استلحقه وإن كان من حرة أو أمة عاهر بها لم يلحق بما استلحقه وإن كان أبوه الذي يدعى له هو ادعاه وهو ابن زنية لأهل أمه من كانوا حرة أو أمة