Praise be to Allah.and peace and blessings be upon the Messenger of Allaah.
Zinaa (fornication or adultery) is a crime that is forbidden by divine laws and rejected by all wise and sane people, even if they are not Muslim. Allaah has condemned those who do this in many aayaat of the Qur’aan and in numerous ahaadeeth of His Prophet (peace and blessings of Allaah be upon him). He has threatened those who do this with severe punishment and disgrace in this world and the next – except those who repent, have faith and do righteous deeds, for Allaah will accept their repentance. The gate of repentance is open, but it is a condition of repentance that one should regret the deed and give it up. Islam wipes out whatever came before.
With regard to the child, he belongs to his mother, and should not be named after his father. This is the ruling concerning the illegitimate child: he should not be named after his father because he was conceived in fornication, not in wedlock. It is obligatory to take care of this child and bring him up with Islamic manners and morals. Because this immoral act has occurred, you must repent from it, but you should cover it up and not disclose it; you do not have to tell the people the truth. If the child wants to know the truth, you can tell him in an appropriate manner, and let him know that what happened was in the days of kufr (before you became Muslim), and that when a person repents and becomes Muslim, this wipes out whatever happened before. The child does not bear any responsibility for what happened, and as long as his mother has become Muslim, there is no grounds for rebuking or punishing her. It is obligatory to accept the will and decree of Allaah, and if this child does righteous deeds he will enter Paradise. No soul is made to bear the burdens of another. We ask Allaah to keep you safe and sound and to forgive you. May Allaah bless our Prophet Muhammad.