Question:
If a person committed Zinā (fornication) with a lady and she falls pregnant, thereafter if he intends to marry her, should he wait for her to give birth and then marry her or could he marry and have relations with her before she gives birth as he is sure that the child is his?
Answer:
If he is definite that the child is his, it would be permissible for him to marry and have relations with her prior to birth, and if he is uncertain of the child being his, he could marry her but he would not be allowed to have sexual relations with her until she gives birth. It should be borne in mind that Zina is a major sin. It is necessary to make tawba from such a crime.
And Allāh alone knows best
Fatāwā Darul Uloom Zakariyyā, vol. 2, pg. 568