The Father
Question :

If a woman has conceived a child before marriage and she marries the same man whose child she is bearing, what will be the ruling about the child?

Answer :

The said child is that of the father by whose sperm he was conceived, as well as being the mother's child. The child belongs to both of them, but does not inherit the father as he was born illegitimately.