Doctors can withdraw life support from a sick baby with a rare genetic condition against his parents' wishes, a High Court judge has ruled.
Specialists at Great Ormond Street Hospital said eight-month-old Charlie Gard has irreversible brain damage and should be moved to palliative care.
His parents Connie Yates and Chris Gard, from London, had wanted to take him to the US for a treatment trial.
They said they were "devastated" by the decision but intended to appeal.
Their solicitor, Laura Hobey-Hamsher, said they could not understand why Mr Justice Francis had not "at least given Charlie the chance of treatment".
She said the couple would take further advice on challenging the ruling once their legal team had studied it.
They have three weeks to lodge an appeal.
Hospital bosses said they would continue to provide life-support treatment until a decision about an appeal had been made.
'Brave and dignified'
In his judgement, Mr Justice Francis said he made the decision with the "heaviest of hearts" but with "complete conviction" that it was in the best interests of the child.
He paid tribute to Charlie's parents for "their brave and dignified campaign on his behalf" and "their absolute dedication to their wonderful boy, from the day that he was born".
The judge, who had visited Charlie in hospital, added: "I know this is the darkest day for Charlie's parents...my heart goes out to them.
"I only hope in time they will come to accept it is in Charlie's best interests to let him slip away peacefully, and not put him through more pain and suffering."
Charlie, who was born on 4 August, has a disorder called mitochondrial depletion syndrome, a rare disease which affects the genetic building blocks that give energy to cells.
It causes progressive muscle weakness and brain damage.
His parents, of Bedfont, west London, had told the Family Division of the High Court they wanted to give their baby "one chance of life".
In their bid to fund the treatment abroad they set up a crowdfunding campaign which has raised in excess of £1.25m from more than 80,000 donors.
A GoFundMe spokesman said it will "be speaking privately to the family" about what would happen to the money raised.
Mr Gard was "shaking and visibly very upset" as he waited for the judgment, BBC News correspondent Helena Lee, who was in court, said.
When the judge ruled the treatment could be withdrawn, he shouted out "no".
Both he and Ms Yates broke down in tears and buried their heads in their hands.
They left the court building without listening to the judge's full reasoning behind his judgement.
During five days of evidence, Mr Justice Francis heard competing arguments over what should happen to Charlie.
Debra Powell QC, representing hospital bosses, had told the court a number of "world-renowned" experts agreed the child should not be given long-term life support as his "quality of life" is "so poor".
Barrister Victoria Butler-Cole, who was appointed to represent the eight month old, said proposed treatment in the US was "purely experimental" and continuing his life support would only "prolong the process of dying".
But the parents' barrister, Sophia Roper, argued Charlie would not suffer significant harm if he was taken to the United States and should be given a chance to improve.
She also claimed his parents' wishes should carry "great weight".
A statement from Great Ormond Street Hospital, released after the ruling, said its doctors had sought "multiple external opinions as to whether therapy could improve Charlie's chance of survival or quality of life" but "the consensus... was that it would not".
"Our focus now is to work with Charlie's family to plan for the next stages in Charlie's care," it said.