She committed zina and got pregnant from a stranger. What should she do?
Question

                There is a married woman who was in a love relationship with a young man before she got married. When she got married she continued this haraam relationship without her husband knowing, until she committed immoral actions with him and got pregnant from him. But she has turned back to Allah and repented, and she is saying: Can she repent? What should she do with the foetus that is in her womb? If she tells her husband then her fate is sealed, namely divorce, and there could be a huge problem if this matter becomes known among her family and her husband’s family. But if I hide this matter from my husband and family, then the child will be illegitimate and that will affect many rulings concerning spending, being alone with the child, ties of kinship, etc. 

I hope that you can help me with regard to this matter, for I am very worried and anxious, but now I am repenting and I regret what I did.
Praise be to Allah.
    Firstly: 

    Undoubtedly what you have done, committing zina (adultery) 
    when you were married, is a major sin. Because zina is a major sin, it is a 
    serious matter when committed by those who are married. Hence the punishment 
    for the unmarried person who commits zina is one hundred lashes, and the 
    punishment for the married person whose marriage was consummated is stoning 
    to death. 

    Secondly: 

    Although the sin that you have committed is so abhorrent to 
    those who have a sound human nature and common sense, it does not mean that 
    you cannot repent. Allaah rejoices over the repentance of sinners and 
    accepts it from them.  

    Allaah says (interpretation of the meaning): 
“Say: O ‘Ibaadi (My 
    slaves) who have transgressed against themselves (by committing evil deeds 
    and sins)! Despair not of the Mercy of Allaah, verily, Allaah forgives all 
    sins. Truly, He is Oft‑Forgiving, Most Merciful”
[al-Zumar 39:53]

    Ibn Katheer (may Allaah have mercy on him) said:  

    This verse is a call to all sinners, kaafirs and others, to 
    repent and turn to Allaah. It tells us that Allaah forgives all sins for the 
    one who repents from them and gives them up, no matter what they are, and 
    even if they are as many as the foam of the sea. End quote. 

    Tafseer Ibn Katheer (7/106). 

    We hope that your repentance is sincere, and includes regret 
    for what you have done, and resolve not to commit the sin again after 
    repenting. 

    Thirdly:

    As for whom the child is to be attributed to – he is to be 
    attributed to your husband if he had consummated the marriage with you, 
    because the Prophet  (peace and blessings of Allaah be upon him) said: 
    “The child is for the bed,” meaning that if a woman has gotten married to a 
    man by means of the marriage contract and he has consummated the marriage 
    with her, if she produces a child, then the child is to be attributed to her 
    husband. 

    Shaykh Ibn Baaz (may Allaah have mercy on him) was asked 
    about a married woman who had three children, and she became pregnant with a 
    fourth child as the result of zina. Is it permissible for her to abort the 
    foetus, or should she keep it? If she keeps it, should she tell her husband 
    or not? And what should the husband do in this case? 

    He replied: It is not permissible for her to abort the 
    foetus. What she has to do is repent to Allaah and not disclose this matter. 
    The child belongs to her husband, because the Prophet  (peace and 
    blessings of Allaah be upon him) said: “The child belongs to the (marital) 
    bed, and the adulterer gets nothing.” May Allaah set all our affairs 
    straight. End quote. 

    Fataawa al-Shaykh Ibn Baaz 
    (21/205). 

    This is the ruling stated in fatwas by the Standing Committee 
    for Issuing Fatwas. We have quoted their fatwas in the answer to question 
    no. 95024. 

    And Allaah knows best.