He lived in sin with his girlfriend and had a child from her and he wants to marry her
Question

                I live in the west and during the last three years I got to know a kitaabi girl (from the people of the Book – Jewish or Christian), and the relationship between us deepened. That was with the approval of her family and mine. After that we had a daughter and we applied for a civil marriage, but the court refused to marry us because the girl has not yet reached the age where marriage is allowed in that country. I had no choice but to go to the imam of our mosque and the girl’s guardian, and two witnesses of good character came, and we got married in this manner. Is the marriage legitimate according to sharee’ah? Do I have to do anything because of the previous years that I spent with this kitaabi girl without being married? Please advise me, may Allaah reward you with good.
Praise be to Allah.
    Firstly: 

    Undoubtedly 
    you did something very wrong for yourself and your religious commitment when 
    you agreed to form a haraam relationship with a Christian woman. As for 
    yourself, that is by committing the sin of zina for which Allaah warns of a 
    severe punishment and decrees the hadd punishment in this world: one hundred 
    lashes for one who is not married and stoning to death for one who is 
    married. As for your religious commitment, that is by giving a bad example 
    of Islam and its morals and rulings to those kuffaar, whether in the land 
    where you live or the family of the woman with whom you are living. How can 
    they respect Islam and the Muslims when they do not see any difference 
    between you and others of the people of the Book? 

    What you –and 
    your family who knew of your sin – must do is repent sincerely from this 
    great sin. You should realize that you did not only fall into the sin of 
    zina which Islam warns against even approaching, but you persisted in that 
    and lived with the woman as man and wife. This makes your sin worse than the 
    sin of others who may fall into the sin of immorality without continuing or 
    persisting in it. 

    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”

    [al-Furqaan 
    25:68-70]

    For more 
    information on the greatness of Allaah’s grace in accepting the repentance 
    of His slaves and that He accepts the repentance of the penitent no matter 
    how serious and numerous their sins, please see the answers to questions no. 
    624, 
    13990, 
    47834, 
    23485 and 
    20983. 

    Secondly: 

    It should be 
    noted that it is not permissible for you to marry this kitaabi woman unless 
    you repent sincerely to Allaah, and until you are certain that she will not 
    commit immoral actions with anyone and that she will not have boyfriends. 
    This is one of the conditions of marriage to a kitaabi woman. 

    Allaah says 
    (interpretation of the meaning): 

    “The food 
    (slaughtered cattle, eatable animals) of the people of the Scripture (Jews 
    and Christians) is lawful to you and yours is lawful to them. (Lawful to you 
    in marriage) are chaste women from the believers and chaste women from those 
    who were given the Scripture (Jews and Christians) before your time when you 
    have given their due Mahr (bridal-money given by the husband to his wife at 
    the time of marriage), desiring chastity (i.e. taking them in legal wedlock) 
    not committing illegal sexual intercourse, nor taking them as girlfriends”

    
    [al-Maa'idah 5:5]

    What you 
    should have done was to tell the one who did the marriage contract for you 
    about your situation and hers, so that he could have enjoined you to repent 
    and told you of the conditions of her being chaste and avoiding zina, and so 
    that you could wait for one menstrual cycle until it was established that 
    she was not pregnant, or until she gave birth if she was pregnant. 

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

    If a woman 
    commits zina, it is not permissible for the one who knows of that to marry 
    her unless two conditions are met: 

    1-
    That 
    her ‘iddah has ended. If she is pregnant as the result of zina then her 
    ‘iddah ends when she gives birth, and it is not permissible to marry her 
    before she gives birth.

    2-
    That 
    she repents from committing zina.

    And he said: 
    If both conditions are met, it is permissible for the zaani (the man who 
    committed zina) or anyone else to marry her according to the majority of 
    scholars, including Abu Bakr, ‘Umar and his son, Ibn ‘Abbaas, Jaabir, Sa’eed 
    ibn al-Musayyab, Jaabir ibn Zayd, ‘Ata’, al-Hasan, ‘Ikrimah, al-Zuhri, 
    al-Thawri, al-Shaafa’i, Ibn al-Mundhir and ashaab al-ra’y. 

    Al-Mughni 
    (7/108, 109)

     Shaykh 
    Muhammad ibn Ibraaheem (may Allaah have mercy on him) said:  

    It is not 
    permissible to marry a woman who has committed zina until she repents. If a 
    man wants to marry her then he must wait for one menstrual cycle to 
    establish that she is not pregnant before doing the marriage contract with 
    her. If it turns out that she is pregnant, it is not permissible for him to 
    do the marriage contract with her until after she gives birth. 

    Al-Fataawa 
    al-Jaami’ah li’l-Mar’ah al-Muslimah 
    (2/584)

    You do not 
    have the right to do the marriage contract in the courts that govern by 
    man-made laws, or in their churches, rather what you did by asking the imam 
    of the mosque to do the marriage contract was the right thing to do. There 
    is nothing wrong with confirming it in the courts for official purposes. 

    The scholars 
    of the Standing Committee said: 

    If the 
    proposal and acceptance are completed, along with all the other conditions 
    of marriage, and it is free from any impediments, then it is valid. If 
    confirming it legally (in the civil court) could serve some shar’i interests 
    of both parties, both now or in the future, then that must be done. 

    Fataawa 
    al-Lajnah al-Daa’imah 
    (18/87). 

    And they 
    said: 

    If the 
    marriage contract is not recognized and no rights will be granted unless it 
    is confirmed in a non-shar’i court, then this does not affect the validity 
    of the marriage, but there is nothing wrong with confirming it in a 
    non-shar’i court if the aim is to record it for official purposes. 

    Fataawa 
    al-Lajnah al-Daa’imah 
    (18/87). 

    Thirdly: 

    As for your 
    daughter, she is the product of an illegitimate relationship and it is not 
    permissible for her to be named after you, rather she should be named after 
    her mother. 

    It was 
    narrated from ‘Amr ibn Shu’ayb from his father that his grandfather said: 
    The Prophet  (peace and blessings of Allaah be upon him) ruled that 
    whoever was born to a slave woman whom his father did not own or to a free 
    woman with whom he committed adultery, then he cannot be named after him and 
    he does not inherit from him, even if the one whom he claims is his father 
    acknowledges him. So he is the product of zina, whether his mother was a 
    free woman or a slave. 

    Narrated by 
    Abu Dawood (2265) and Ibn Maajah (2746); classed as hasan by al-Albaani in
    Saheeh Abi Dawood. 

    The scholars 
    of the Standing Committee said, concerning a similar case: 

    The daughter 
    mentioned, who is the result of illicit relations with her mother, is not 
    your daughter according to sharee’ah, and it is not permissible for her to 
    be named after you, because she was born from haraam water, which is zina. 
    So she should be named after her mother and not after the one who committed 
    zina with her. 

    Fataawa 
    al-Lajnah al-Daa’imah 
    (18/321, 322)                              

    If it is not 
    possible to name the child after the mother in the land where the mother 
    lives, she may be given a name which does not belong to anyone in 
    particular, so she may be given a name to use in official papers and 
    documents. 

    See also the 
    answer to question no. 12283 – which is important – and also 
    117, 
    33591, 
    2103 and 
    33615. 

    We should also 
    remind you that it is haraam to settle in a kaafir land, and you should 
    learn a lesson from what happened to you and try to leave that land and 
    settle in a Muslim country where you will see Islam being practised openly 
    and you will be able to raise your children to follow Islam, be chaste and 
    have good attitudes. 

    See the 
    answers to questions no. 20227 and 
    45645 for more information on the 
    negative consequences of marrying non-Muslim women. 

    And Allaah 
    knows best.