We ask Allaah to forgive you and pardon you, for zina is a major sin and a serious crime, especially on the part of one whom Allaah has blessed with marriage, but she was ungrateful for the blessing of Allaah, 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 Allaah, and Allaah 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.
Allaah says (interpretation of the meaning):
“And those who invoke not any other ilaah (god) along with Allaah, nor kill such person as Allaah has forbidden, except for just cause, nor commit illegal sexual intercourse ___and whoever does this shall receive the punishment.
69. The torment will be doubled to him on the Day of Resurrection, and he will abide therein in disgrace;
70. Except those who repent and believe (in Islamic Monotheism), and do righteous deeds; for those, Allaah will change their sins into good deeds, and Allaah is Oft‑Forgiving, Most Merciful”
So continue repenting and turning to Him, beseeching Allaah to accept it from you, and Allaah accepts the repentance of those who repent.
One of the signs that Allaah 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 Allaah for having helped you to pray regularly and wear hijab, and to obey Him and repent. We hope that Allaah, the Most Generous and Most Merciful, has forgiven you, and we ask Him to do that.
If Allaah has concealed you, then do not break that 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’aan, because the basic principle is that the child belongs to the marital bed, as the Prophet (peace and blessings of Allaah 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. If the owner of the bed wants to deny the child by engaging in li’aan then he may do that before the shar’i 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 Allaah is the source of strength.
End quote from Fataawa al-Lajnah al-Daa’imah (20/339).
See also the answer to question no. 85043.
And Allaah knows best.