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, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
If a girl commits fornication, she is obliged to take the initiative to repent. Similarly, the man who committed fornication with her is obliged to repent. If he wants to marry her, he should not do so unless he makes sure that she is not pregnant; this is the best thing to do in order to avoid the difference of opinion among the scholars about a fornicator marrying the girl or the woman he fornicated with before making sure she is not pregnant. For more benefit, please refer to Fatwa 83680.
If marriage takes place before making sure the girl is not pregnant, then according to the scholars who are of the view that such marriage is correct then this marriage should continue. However, according to those who are of the view that such marriage is not valid, it should be invalidated.
Nonetheless, an ordinary person should act according to the view of the School of jurisprudence which he follows, or according to view of whoever he usually refers to seeking a Fatwa on matters.
The child born out of fornication [or adultery] is not traced back to the man who fornicated with his mother, that is because Zina (fornication or adultery) does not imply any religious ruling, like family lineage and becoming a Mahram (i.e. a person whom one is permanently prohibited from marrying due to suckling, marital, or blood relations) or any other ruling. However, it should be noted that some scholars are of the view that it is forbidden for a man to marry his daughter or sister from fornication despite them not having any lineage relation.
Whoever established an illegal relationship with a girl or a woman is obliged to repent to Allaah, but this relationship is not a religious obstacle for marrying her. Nonetheless, if this relationship led to fornication, then the difference of opinion among the scholars apply to it in regard to a fornicator marrying the girl or woman he fornicated with.
Furthermore, it should be noted that it is not permissible for a Muslim to marry a non-Muslim woman who is not from the people of the Book. For more benefit, please refer to Fatwa 85843.
Finally, if a person knows that a man is in illegal relationship with a woman, he is obliged to forbid them from this relationship according to his ability as the Prophet said: "Whoever amongst you sees an evil, he should change it with his hand (i.e. physically), if he is unable, then he should change it with his tongue (i.e. verbally) and if he is unable, then he should change it with his heart (by detesting it in his heart) and that is the weakest level of faith." [Muslim]