Committed Adultery and Uncertain Who Child Should be Attributed to
We ask Allah to forgive you and pardon you, for zina is a major sin and a serious crime, especially on the part of one whom Allah has blessed with marriage, but she was ungrateful for the blessing of Allah, betrayed her husband, transgressed his honour and contaminated his bed. Hence the punishment for this married woman is to be stoned to death, as a punishment from Allah, and Allah is Almighty and Most Wise.
But by His Mercy, He shows kindness to His slaves, gives them respite and invites them to repent, and He accepts repentance and gives reward for it. How merciful, great and kind He is, may He be glorified and exalted.
Allah says (interpretation of the meaning):
“And those who invoke not any other ilah (god) along with Allah, nor kill such persons as Allah has forbidden, except for just cause, nor commit illegal sexual intercourse ___and whoever does this shall receive the punishment.
The torment will be doubled to him on the Day of Resurrection, and he will abide therein in disgrace;
Except those who repent and believe (in Islamic Monotheism), and do righteous deeds; for those, Allah will change their sins into good deeds, and Allah is Oft‑Forgiving, Most Merciful.”
So continue repenting and turning to Him, beseeching Allah to accept it from you, and Allah accepts the repentance of those who repent.
One of the signs that Allah has accepted repentance is that He conceals His slave and does not expose him, and He extends his life span so that he will draw close to Him and make his peace with Him. We praise Allah for having helped you to pray regularly and wear hijab, and to obey Him and repent. We hope that Allah, the Most Generous and Most Merciful, has forgiven you, and we ask Him to do that.
If Allah has concealed you, then do not break the concealment that He has bestowed upon you, and do not tell your husband or anyone else anything about what happened. Your repentance is regret and righteousness and doing good deeds.
As for the child, he is to be named after your husband, and that is not cancelled out unless he rejects the child by means of li’an (an Islamic procedure in which a man denies a child being his), because the basic principle is that the child belongs to the marital bed, as the Prophet (peace and blessings of Allah be upon him) said.
The scholars of the Standing Committee were asked: There is a married woman who committed zina when she was still married. She got pregnant as a result and gave birth to a child, either male or female. With whom should that child stay? Should he stay with her husband based on the hadeeth “The child is for the (owner of the) bed and the fornicator gets nothing” or not? If he stays with his mother’s husband, should he adopt him and regard him as one of his own children with regard to all rights, or will he just be under his care only? But if he is attributed to the adulterer, should he regard him as one of his real children or keep him with him even though he is still illegitimate?
They replied: If a married woman commits zina and becomes pregnant, then the child belongs to the (owner of the) bed (i.e. the husband), because of the saheeh hadeeth (authentic report). If the owner of the bed wants to deny the child by engaging in li’an then he may do that before the shar’i (Islamic) judge, and in that case the child does not belong to anyone according to the consensus of the Muslims. But adoption is not permissible and the adopted child does not truly become the child of the one who adopted him. And Allah is the source of strength.
End quote from Fatawa al-Lajnah al-Daimah (20/339).
See also the answer to question no. 85043
And Allah knows best.