Is IVF (In-Vitro Fertilization) Allowed in Islam?
Question

I just wanted to know that is it permissible in the Quran and Sunnah to have a IVF (In-Vitro Fertilization) treatment for children. One of the sisters I know has been trying for a while to have children but she is finding it very difficult. So, I would appreciate it if you could reply as soon as possible.
Praise be to Allah.Children in Islam are a bliss
Undoubtedly children are one of the blessings and adornments of this world, and one of the greatest purposes of marriage is to produce offspring. A righteous child is a treasure for his parents in this world and in the Hereafter, and his righteous deeds will be recorded in the balance of his parents’ deeds. 
A man or a woman may be faced with lack of children or delay of having children. What they must do is be patient and seek reward, and say a lot of du’a and prayers for forgiveness. They should understand that Allah only decrees things for a reason. 
If a person has available Islamically acceptable means of getting children, there is nothing wrong with pursuing that. But the Muslim should beware of false ways involving sihr (witchcraft) and myths, and he should beware of doctors who do not fear Allah and whose main aim is to make money from those who want to have children. Hence some of them switch eggs or sperm. This is why some scholars have forbidden these methods of having children or have stipulated very strict conditions. 
What is IVF?
One of the methods that doctors use to help couples have children is that which is mentioned in the question, namely IVF (In-Vitro Fertilization). This method involves stimulating the ovary to produce a number of eggs, similar to the way in which a woman naturally produces one egg. 
How is IVF done?
This is done by giving the woman an injection of Decapeptyl to prepare the ovaries for the next step, which is injections of hormones to stimulate the ovaries to produce a number of eggs. After ascertaining that the eggs have grown, the woman is given an injection of HCG to complete the development of the eggs before they are extracted. This injection is usually given 36 hours before the eggs are extracted. 
On the day on which the eggs are extracted, semen is taken from the husband and 100,000 sperm are placed with each egg in a test tube so that fertilization may take place. Two or three days later, the fertilized eggs divide to form what is called the embryo, and the embryos are divided into categories according to their quality. The best embryos are selected to be returned to the uterus, where they are placed, and later on an examination is carried out to make sure whether there is a pregnancy or not. The success rate of this procedure according to doctors is 30-40 %. 
This summary was mentioned by Dr Usamah Salihah, a specialist in gynaecology, obstetrics, infertility and laparoscopic surgery in Britain, and the director of the test tube baby unit in the new Dar al-Shifa Hospital. (From al-Watan Clinic magazine)
Is IVF (In-Vitro Fertilization) Allowed in Islam?
With regard to the Shar’i ruling on IVF, it should be disallowed, in order to be on the safe side. This is the view of Shaykh ‘Abd-Allah al-Jibrin (may Allah preserve him) and it was quoted from the scholars of the Standing Committee. 
Conditions for allowing IVF 
However, IVF (In-Vitro Fertilization) may be permissible subject to certain conditions, including the following: 
1 – That there is a real need for that. A delay of one or two years in having children is not an excuse for the couple to pursue this or similar methods. Rather they should be patient, for Allah may grant them a way out soon without them doing anything that is haram. 
2 – The woman should not uncover her ‘awrah before men when there is female staff available. 
3 – It is not permissible for the husband to masturbate, rather he may be intimate with his wife without penetration, and produce semen in this manner. 
4 – The woman’s eggs and man’s sperm should not be kept in a freezer for later use , or another appointment, and there should not be any delay in placing them in the woman’s uterus. Rather that should be done immediately without any delay, lest they be mixed with others or be used for other people. 
5 –The sperm must come from the husband and the egg from the wife, and be implanted in the wife’s uterus . Anything else is not permissible at all. Please see the answer to question no. 21871 . 
6 – There should be complete trust in the doctors who are doing this procedure. 
Shaykh Muhammad ibn Salih al-‘Uthaymin (may Allah have mercy on him) was asked about the ruling on putting a woman’s egg in a test tube then fertilizing it with the man’s sperm, then returning it to the woman’s uterus so that it may develop. 
He replied: 
“(a) If there is no need for this procedure, then we do not think it is permissible, because it involves surgery to extract the eggs – as you mention in the question – and this surgery involves uncovering the ‘awrah unnecessarily, then it involves surgery and there is the fear that it may have effects even in the distant future, such as damaging the Fallopian tube or causing infections.
Moreover, if things are left to proceed naturally as created by the Most Merciful of those who show mercy and the Wisest of judges, that is closer to proper etiquette with Allah and it is better and more beneficial than ways invented by man, which may appear initially to be good but they fail later on. 
(b) If there is a need for this procedure, then we do not think there is anything wrong with it, so long as three conditions are met:
1 – That this fertilization be done with the husband’s sperm. It is not permissible to use the sperm of anyone but the husband for this fertilization, because Allah says (interpretation of the meaning): 
“And Allah has made for you Azwaj (mates or wives) of your own kind, and has made for you, from your wives, sons and grandsons, and has bestowed on you good provision. Do they then believe in false deities and deny the Favour of Allah (by not worshipping Allah Alone)” [al-Nahl 16:72]
2 – The collection of sperm from the man should be done in a permissible manner, such as by the husband being intimate with his wife, and ejaculating between her thighs or in her hand, so that the semen may be emitted, then the egg may be fertilized with it. 
3 – After fertilization, the egg should be placed in the wife’s uterus. It is not permissible to place it in the uterus of any other woman under any circumstances whatsoever, because that involves inserting the sperm of the man into the uterus of a woman who is not permissible for him, and Allah says (interpretation of the meaning): 
“Your wives are a tilth for you, so go to your tilth, when or how you will, and send (good deeds, or ask Allah to bestow upon you pious offspring) for your own selves beforehand. And fear Allah, and know that you are to meet Him (in the Hereafter), and give good tidings to the believers (O Muhammad)” [al-Baqarah 2:223]
Tilth is mentioned specifically with regard to a man’s wife, which indicates that a woman other than his wife is not appropriate for his tilth.” (Majmu’ Fatawa al-Shaykh al-‘Uthaymin, 17:27-28) 
And he (may Allah have mercy on him) also said: 
“Artificial fertilization is when the husband’s sperm is taken and placed in the uterus of the wife by means of a syringe. This is a very serious issue. Who can be certain that the doctor will not put the sperm of one man in the uterus of someone else’s wife?! Hence we think that precautions must be taken and we should not issue fatwas except in specific cases where we know the man, the woman and the doctor. As for opening the door to this, there is the fear of evil consequences.  
The matter is not to be taken lightly, because if any deceit takes place, it means that lineages will be mixed, and there will be chaos, which is something that shari’ah has forbidden. Hence the Prophet (peace and blessings of Allah be upon him) said: “One should not have intercourse with a pregnant woman until she gives birth.” I will not issue fatwas to this effect, unless a specific case is referred to me and I know the man, the woman and the doctor.” (Majmu’ Fatawa al-Shaykh Ibn ‘Uthaymin, 17/question no. 9) 
This is the verdict of the Islamic Fiqh Council of the Organization of the Islamic Conference in which it says: “There is nothing wrong with resorting to this in the case of need, but it is absolutely essential to take all necessary precautions.” (Majallat al-Majma’, 3/1/423) 
We ask Allah to bless the couple with righteous offspring with no need for such methods, and to enable them to bear this trial with patience. 
And Allah knows best.