The Messenger of Allah ﷺ ruled that whenever a child is claimed after the death of the father to whom he is attributed, and the father's heirs claim him on his behalf, the ruling is as follows.If the child was born to a slave woman whom the father owned at the time he had relations with her, then the child is attached to those who claimed him, but he has no share in any inheritance that was distributed before his claim was established. He receives only his share of any inheritance not yet divided. He cannot be attached to the father if the father to whom he is attributed denied him during his lifetime.If the child was born to a slave woman the father did not own, or to a free woman with whom he committed fornication, then the child is not attached to him and does not inherit from him, even if the father to whom he is attributed is the one who claimed him. Such a child is one of fornication, and he belongs to his mother's family, whoever they are, whether she was free or a slave.
حدثنا هاشم بن القاسم حدثنا محمد يعني ابن راشد عن سليمان يعني ابن موسى
أن رسول الله ﷺ قضى أن كل مستلحق يستلحق بعد أبيه الذي يدعى له ادعاه ورثته من بعده فقضى إن كان من أمة يملكها يوم أصابها فقد لحق بمن استلحقه وليس له فيما قسم قبله من الميراث شيء وما أدرك من ميراث لم يقسم فله نصيبه ولا يلحق إذا كان أبوه الذي يدعى له أنكره وإن كان من أمة لا يملكها أو من حرة عاهر بها فإنه لا يلحق ولا يرث وإن كان أبوه الذي يدعى له هو الذي ادعاه وهو ولد زنا لأهل أمه من كانوا حرة أو أمة