Taking terminally ill patients off life support machines
It is permissible to take terminally ill patients off life support machines which sustain life without improving a patient's prognosis. Such patients are declared 'clinically dead' and are taken off life support only upon the recommendation of a physician. However, it is impermissible to take patients off machines that are for other purposes such as suction machines used to aspirate fluids to facilitate breathing.
Taking a 'clinically dead' patient off life support is different from what is called 'mercy killings' which involves a patient asking his physician to end his life or the physician making an independent decision to end his patient's suffering and pain. This is definitely prohibited since, in this case, a patient's life can continue and is not dependent upon life support machines; it is the patient himself or his physician who seek to end his life due to extreme pain. In such a case, ending a patient's life is tantamount to killing a soul which Allah has prohibited except by [legal] right.
Dar al-Ifta al-Misriyyah has previously issued a fatwa on Euthanasia under no. 2689 dated 7/11/2004.
Allah Almighty knows best.