British doctors can allow a baby to "die with dignity" despite his parents' wish to take him to the US for treatment, a high court judge ruled on Tuesday.
Justice Nicholas Francis ruled with the "heaviest of hearts" but "complete conviction" that life support treatment in London for eight-month-old Charlie Gard should be ended.
The baby boy suffers from a rare genetic condition and has brain damage, from which he will not recover according to experts consulted by the court.
The judge's ruling was met with a scream of "no!" and Charlie's parents, Connie Yates and Chris Gard, wept as the decision was announced.
Specialists at Great Ormond Street Hospital, where the baby is being treated, had asked the judge to rule it is legal to withdraw life-support treatment.
Francis had visited baby Charlie in hospital and during the ruling praised staff there for the "extraordinary care" provided to the child and his family.
"Most importantly of all, I want to thank Charlie's parents for their brave and dignified campaign on his behalf, but more than anything to pay tribute to their absolute dedication to their wonderful boy," he said.
The child's parents had hoped to take him to the US where he would undergo a treatment trial for his form of mitochondrial disease.
More than £1.2 million ($1.5 million, 1.4 million euros) was raised online for the treatment, through more than 80,000 donations.
The family's lawyer Laura Hobey-Hamsher said they were "devastated" by the court's decision and would consider appealing.
Explore further: French court orders hospital to continue baby's treatment