Doctors can stop providing life-support treatment to a five-year-old girl who is in a vegetative state, a High Court judge has ruled.
Mr Justice Poole said it was not in Pippa Knight's "best interests" to keep her on a ventilator.
The child's mother, Paula Parfitt, said she was "devastated" by the ruling and would be seeking permission to take her case to the Court of Appeal.
Pippa initially developed normally after being born in April 2015, but in December 2016 she became unwell and began to suffer seizures.
A rare condition was diagnosed - acute necrotising encephalopathy - which led to brain damage.
Specialists treating her at the Evelina Children's Hospital in London advised that life-support treatment should end.
Hospital bosses asked Mr Justice Poole to rule that allowing Pippa to die would be lawful and in her best interests.
Ms Parfitt disagreed, and wanted Pippa to be placed on a portable ventilator and taken home for a two-week trial period.
"Two independent doctors from reputable hospitals in England both said that they thought this was worth trying," she said, adding that she had been at Pippa's side every day since she was admitted to hospital two years ago.
But the judge, who heard evidence in the Family Division of the High Court in December, ruled on Friday that life-support treatment should end and Pippa be allowed to die.
She has "no conscious awareness of her environment" or "interactions with others", he said.
The judge added: "Therefore, there would be no benefit to her from being in a home bedroom as opposed to a hospital unit.
"Family members may be able to spend more time with her at home in a more peaceful and welcoming environment, but she would not be aware of their visits or of the benefit to others."
Mr Justice Poole said Ms Parfitt, 41, from Strood in Kent, had "fought as hard for Pippa as any parent could".
But he continued: "Responsibility for the decisions in this case lies with the court, not with her.
"My conclusion is that continued mechanical ventilation is contrary to Pippa's best interests."
He also said he could not "give weight to Ms Parfitt's view that home care would improve Pippa's condition, because it is at odds with the unanimous view of the clinicians and medical experts".
Ms Parfitt said: "I am devastated by the judgment of Mr Justice Poole today that it is not in Pippa's best interests to have a two-week trial of portable ventilation to find out whether she could come home.
"The medical experts and the treating doctors said that Pippa was not in any pain.
"I don't understand why the hospital and the court wouldn't let me find out whether Pippa could come home to be cared for with all her family around her, when two independent doctors from reputable hospitals in England both said that they thought this was worth trying.
"Instead, the court has decided that all Pippa's treatment should be withdrawn so that she dies.
"I will be seeking permission to appeal to the Court of Appeal.
"I want Pippa to have every possible chance to come home and be with her family."