All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
Fornication (Zina) is a grave sin and a heinous act. Whoever commits Zina must repent to Allaah from such a sin. Repentance is not considered sincere unless it meets all the due conditions underlined in Fatwa 86527.
It is impermissible for a Muslim man to marry a woman who has committed Zina before she repents from her sin and makes Istibraa' (i.e. gives birth if she is pregnant or observes a waiting period of three menses according to one view of the scholars, or one menses according to another view), according to the most evident opinion of the scholars of Islam. However, since the marriage has already taken place, it is considered valid according to the another scholarly opinion in this regard, so as to avoid undue hardship.
When a married woman gives birth to a child after six months of marriage, the child bears the name of the husband because it was born while he was married to her and within a timeframe that it is possible for her to have conceived it, as underlined in Fatwa 84301. In this case, the doctor’s opinion that the child is not the husband’s biological son is not to be taken into consideration.
However, this woman must conceal her sin and she should not tell her husband or anyone else of it. For more benefit, please refer to Fatwa 89050.
We would like to underline the danger of neglecting the Islamic teachings regarding mixing between men and women within the family. Disregard of the due Islamic manners in the interactions and visits of the non-Mahram female relatives, staying with non-Mahrams in seclusion, non-adherence to the Islamic Hijab on part of women when in the presence of non-Mahram men, and other practices like these, lead to such temptations and ordeals.
Allaah Knows best.