If a man divorces his wife as the result of khula’ or he gives her a final talaaq, and she is pregnant, then he must spend on her and on the child according to scholarly consensus; that includes the expenses of the birth.
Ibn Qudaamah (may Allaah have mercy on him) said: If a man divorces his wife in an irrevocable divorce, which is either a third talaaq or khula’, or an annulment of the marriage, and she is pregnant, then she is entitled to maintenance and accommodation, according to scholarly consensus, because Allaah says (interpretation of the meaning):
“Lodge them (the divorced women) where you dwell, according to your means, and do not harm them so as to straiten them (that they be obliged to leave your house). And if they are pregnant, then spend on them till they lay down their burden”
According to some reports about Faatimah bint Qays: “You are not entitled to maintenance unless you are pregnant.” Because the pregnancy is his child, so he is obliged to spend on it and he cannot spend on him (the child) without spending on her (the mother), so it becomes binding on him to spend on her too, and he must also pay her for breastfeeding. End quote from al-Mughni (8/185).
As the wife is pregnant, then she is entitled to maintenance, unless she lets her husband off, such as if she divorces him by khula’ on the basis that she will cover her own expenses during pregnancy, or expenses during pregnancy until she gives birth, or until the child is weaned. Ibn Qudaamah said: If a woman divorces her husband by khula’ and lets him off paying her maintenance during her pregnancy, she has no right to maintenance and neither does the child, until he is weaned. But if she divorces him by khula’ and does not let him off paying her maintenance during her pregnancy, then she is entitled to maintenance, just as if he divorced her with a third talaaq when she was pregnant, because the pregnancy is his child, and he must support it. End quote from al-Mughni (8/188).