Praise be to Allah.
Yes, some scholars are of the view that it is permissible to abort the foetus before forty days, and others are of the view that that is haraam.
Among those who regard it as permissible, Ibn al-Humaam al-Hanafi said in Fath al-Qadeer (3/401): Is it permissible to abort it after becoming pregnant? It is permissible, so long as no features have begun to appear.
It may be that what they meant by features appearing is when the soul is breathed into the foetus, which happens after one hundred and twenty days of pregnancy. Or it may be that what they meant is the appearance of features even though the soul has not yet been breathed into it, which does not happen before eighty days of pregnancy, and most likely occurs at ninety days.
In Haashiyat Qalyoobi wa ‘Umayrah (a Shaafa’i book) (4/160) it says: Yes, it is permissible to abort it, even by using medicine, before the soul has been breathed into it, unlike what al-Ghazaali said. End quote.
Al-Mardaawi said in al-Insaaf (a Hanbali book) (1/386): It is permissible to take medicine to abort a nutfah. That is stated in al-Wajeez. Ibn al-Jawzi said in Ahkaam al-Nisa’: It is haraam. It says in al-Furoo’: The apparent meaning of the words of Ibn ‘Aqeel in al-Funoon is that it is permissible to abort it before the soul is breathed into it. He said: There is some validity in this view. End quote. Shaykh Taqiy al-Deen said: It is better for a woman not to use medicine to prevent the sperm from taking its course. End quote.
Among those who do not allow it, al-Dardeer said in his commentary on Khaleel (a Maaliki book) (2/266): It is not permissible to expel the maniy from the womb even if that is before forty days, and once the soul has been breathed into it, it is haraam according to consensus. End quote.
Al-Ramli said in Nihaayat al-Muhtaaj (a Shaafa’i book) (8/442): al-Muhibb al-Tabari said: The scholars differed concerning the nutfah before forty days, and there are two views. It was said that it is not proven that it comes under the same ruling as abortion and infanticide, and it was said that it is protected and it is not permissible to harm it, and it should not be expelled after it has settled in the womb, unlike ‘azl (coitus interruptus) which occurs before it reaches the womb. Al-Ghazaali referred to this matter in al-Ihya’ and said, stating that ‘azl is unlike the former case: This is not like abortion and infanticide because those are offences against a living being. The first stage of existence is when the sperm reaches the womb and mixes with the woman’s water, so harming it is an offence. If it has become an ‘alaqah or a mudghah, then the offence is more serious, and if the soul has been breathed into it and it has become a human being then the offence is even worse. Then he said: It is unlikely that it is not forbidden. End quote.
To sum up, the fuqaha’ differed concerning this issue, so you should not do that unless there is a good reason, so that you will avoid falling into haraam and will be on the safe side with regard to your religious commitment.
There is another matter which should not be ignored, which is that you should appreciate the blessing of Allaah in giving you a child. His blessing should be accepted with joy, gratitude and contentment. No one knows, if he rejects this blessing, whether it will come to him again or not?
Hence we advise you to keep this pregnancy and to accept it and appreciate the blessing of Allaah. Perhaps this will open the door to greater provision, both material and spiritual, and it may bring mental stability and marital harmony. If you choose the other option, that should be after paying istikhaarah and asking Allaah for guidance, because no one knows where goodness lies. That should also be done with the wife’s consent, because she has the right to a child, and the fuqaha’ have stated that a man cannot withdraw (‘azl) from a free wife without her permission.
And Allaah knows best.