Doctors should follow the wishes of terminally ill patients when the risks and benefits of treatment are finely balanced, according to new guidance.
Medics need to let patients have the final say and will not be expected to provide treatments that could do harm or have no clinical benefit.
When the benefits and harms carry a comparable weight, people who have requested to keep receiving food and fluids until they die should be granted that wish. However, those who would prefer to die quickly can ask for these to be withdrawn.
Doctors should also consider a patient's wishes on whether they are resuscitated or not into account before choosing treatment, the General Medical Council's (GMC) new guidance says.
"When the benefits, burdens and risks are finely balanced, the patient's request will usually be the deciding factor," the guidance said.
The UK-wide guidance encourages doctors to discuss plans with patients and their families ahead of time, particularly for people who are not expected to live beyond another year.
It says doctors must start from a presumption that life should be prolonged and "must not be motivated by a desire to bring about the patient's death". It stops short of discussing assisted suicide, which is illegal in the UK.