A seriously ill two-month-old baby who doctors say feels pain when held should be allowed to die, a High Court judge has decided.
Specialists told Mr Justice Williams that the boy was being sedated when handled to reduce his agitation.
They said he should move to a children's hospice and receive palliative care.
The boy's mother, who has learning difficulties, wanted her son to continue to receive life-sustaining medication.
A man thought to be the boy's father also wanted treatment to continue and asked the judge to postpone a decision.
But Mr Justice Williams refused to delay a decision and concluded that a move to a palliative care regime at a hospice was in the boy's best interests.
He made the ruling late on Wednesday after analysing the case at a private hearing in the Family Division of the High Court in London.
The judge said the case could be reported but he said neither the baby nor the NHS hospital trust which asked for treatment to be withdrawn could be named.
Doctors said the boy had weighed less than 4lb (1.74 kg) when born in May and had serious heart and neurological abnormalities.
They said there was no hope of improvement and even if he continued to receive medication he would probably not live until Christmas.
But they said he endured daily pain and suffering.
Barrister Claire Watson, who represented hospital bosses, told the judge that doctors said handling involved "discomfort" and "what is perceived to be pain".
One specialist said the boy "didn't like being handled" and "grimaced when she picked him up".
The judge was told that the boy was "now sedated when handled" to "relieve agitation".
Mr Justice Williams heard that the boy had been placed into council care because his mother's condition meant that she was unable to meet his needs.
He was told that the boy had been in hospital since birth.
Social services bosses with parental responsibility had wanted a judge to make a decision about whether treatment should continue.
Mr Justice Williams said he had taken the view of the boy's mother, and the man thought to be the father, into account.
"I wholly understand the mother's desire to prolong life for as long as possible," the judge said.
"But her wishes have to be viewed against the medical evidence."
He added: "I entirely understand if they disagree with my decision."
Mr Justice Williams said the decision was difficult but the boy's best interests were paramount.
"Ultimately the balance is quality of life against length of life," he said.
"Life is precious."
He added: "It is an extremely difficult balance to judge."
Copyright (c) Press Association Ltd. 2018, All Rights Reserved. Picture (c) Kate Collins / PA Wire.