«كل مستلحق بعد أبيه الذي يدعى له ادعاه ورثته من بعده من كان من أمة يملكها يوم أصابها فقد لحق بمن استلحقه وليس له فيما قسم قبله من الميراث شيء وما أدرك من ميراث لم يقسم فله نصيبه ولا يلحق إذا كان أبوه الذي يدعى له أنكره وإن كان من أمة لا يملكها أو من حرة عاهر بها فإنه لا يلحق ولا يورث وإن كان الذي يدعى له هوادعاه فهو ولد زنا لأهل أمه من كانوا حرة أو أمة»
The Prophet (peace and blessings be upon him) said:
"Every person whose lineage was attributed, after the death of his (claimed) father, to that father by his heirs: if he is from a slave woman whom the (father) owned on the day he had relations with her, then he is joined to the one who attributed him (to himself), but he has no share in the inheritance that was divided before this; as for the inheritance that has not yet been divided, he will get his share of it. And if that father, to whom his lineage is being claimed, had himself denied him, then he will not be joined. And if he is from a slave woman whom the (father) did not own, or from a free woman with whom he committed fornication, then he will neither be joined to him nor will he inherit. And even if the one to whom his lineage is being claimed had himself claimed him, he is still a child of fornication and (his lineage) is with his mother's people, whoever they are, whether she is free or a slave woman."
Hadith Referenceصحیح الجامع الصغیر / حرف الكاف / 4549