What should they do now? Do they have to annul their marriage now and then repeat it without any need for ‘iddah? Does this mean that their children are the result of haraam and immoral actions (are they illegitimate)? Do they come under the ruling on zaanis (fornicators) for the duration of their marriage? Is annulment a straightforward procedure, or is it a lengthy process like talaaq (divorce)? Can they be excused because of their ignorance? All they want to do is live a clean married life that is pleasing to Allah, may He be blessed and exalted. Please note that the girl got her period once before they got married and the young man did not have intercourse with her after that until after they got married; that is, he wanted to make sure that she was not pregnant before marriage. Allah knows that they did not know that repentance is stipulated as a condition of marriage being valid, otherwise they would not have hesitated to repent straightaway at that time. What about the children, do they not deserve some consideration in this situation? Can they stay together for the sake of the children only, without any sexual intimacy? I tried to find out about the matter as much as I could so that all aspects of it would be clear, because they found two contradicting opinions that only increased their confusion, and they do not know which way to proceed. They do not want to live in haraam and they hope that you can explain with detailed evidence.
It is not permissible for the zaani (fornicator or adulterer) to marry the zaaniyah (fornicatress or adulteress) except after repenting because Allah, may He be exalted, says (interpretation of the meaning):
“The adulterer marries not but an adulteress or a Mushrikah and the adulteress none marries her except an adulterer or a Muskrik. Such a thing is forbidden to the believers (of Islamic Monotheism)”
Repentance is achieved by regretting (what one has done) and resolving not to go back to the sin. This may have happened in the case asked about here, hence they gave up zina and wanted to live a clean life that is pleasing to Allah, as you say, and they wanted to be on the safe side by making sure that she was not pregnant as a result of something haraam.
The fuqaha’ differed concerning the validity of a marriage between two who committed zina, if the marriage was done before they repented. The majority are of the view that it is valid, but the Hanbalis are of the view that it is not valid, and this is the more correct view. See question no. 85335
What is required in that case is to repeat the marriage contract. The matter does not require a talaaq (divorce); rather it is a repeat of the marriage contract, in which the woman’s wali (guardian) may be her Muslim father, brother or any other male relative on the father’s side, so long as he is Muslim. If she has no male Muslim relatives, then the imam of the Islamic Centre may act as her guardian for the purpose of marriage, in the presence of two Muslim witnesses.
It is not essential to tell the one who does the marriage contract of the details of the situation; it is possible to use double entendres and to say that they want to repeat the marriage contract because of some uncertainty about its validity, because they got married without a wali, or for some other appropriate reason, or because it was done in another city or country, and so on, because the Muslim is enjoined to conceal his faults and mistakes.
The children who were born under the previous marriage contract should be attributed to the husband, because they were born in a marriage that both spouses believed to be valid.
And Allah knows best.