Treatment for a brain-damaged boy in a coma should stop, a judge has ruled.
Archie Battersbee, 12, was found unconscious at his home in Southend, Essex, on 7 April.
Doctors treating him at the Royal London Hospital in east London told the High Court it was "highly likely" he was "brain-stem dead" and asked for his life support to end.
Archie's mother Hollie Dance said she was "devastated" and the family planned to appeal.
The court previously heard that Archie suffered brain damage during an incident at home, which his mother believed may have been related to an online challenge.
He has not regained consciousness since.
Archie's mother, and his father Paul Battersbee, disagreed with the hospital and have been supported by the Christian Legal Centre campaigning organisation.
In a statement issued after the court decision, Ms Dance said: "I am devastated and extremely disappointed by the judge's ruling after weeks of fighting a legal battle when I wanted to be at my little boy's bedside.
"Basing this judgement on an MRI test and that he is 'likely' to be dead, is not good enough. This is believed to be the first time that someone has been declared 'likely' to be dead based on an MRI test."
She said she felt "sickened" that the hospital and judge had not taken into account the wishes of the family and added she did "not believe Archie has been given enough time".
"His heart is still beating, he has gripped my hand, and as his mother, I know he is still in there," she said.
"Until it's God's way I won't accept he should go. I know of miracles when people have come back from being brain dead.
"We intend to appeal and will not give up on Archie."
Lawyers representing the hospital's governing trust, Barts Health NHS Trust, had asked the judge to decide what moves were in Archie's best interests.
During a three-day hearing at the court's Family Division last week, specialists said tests had shown no "discernible" brain activity.
In a written ruling, Mrs Justice Arbuthnot concluded Archie died at noon on 31 May based on MRI scans that day.
She said: "I find that irreversible cessation of brain stem function has been conclusively established.
"I give permission to the medical professionals at the Royal London Hospital to cease to ventilate mechanically Archie Battersbee."
Mrs Justice Arbuthnot said the devotion of Archie's family was "extraordinary".
"If Archie remains on mechanical ventilation, the likely outcome for him is sudden death and the prospects of recovery are nil," she said.
"He has no pleasure in life and his brain damage is irrecoverable.
"His position is not going to improve.
"The downside of such a hurried death is the inability of his loving and beloved family to say goodbye."
The judge said that, had she not concluded Archie was dead, she would have ruled that it was not in his best interests to continue to receive life-support treatment.
"The steps I have set out above are lawful," she added.
Alistair Chesser, chief medical officer at Barts Health NHS Trust, said their "thoughts and sympathies" were with Archie's family.
Speaking outside the Royal London Hospital following the ruling, Mr Chesser said: "In line with the guidance issued by the court, our expert clinicians will provide the best possible care while life support is withdrawn.
"We are also ensuring that there is time for the family to decide whether they wish to appeal before any changes to care are made."