LONDON, July 27 (Reuters) - Charlie Gard will spend his final hours in a hospice before a ventilator that keeps him alive is turned off, a judge ruled on Thursday, after a harrowing legal battle that prompted a debate over who has the authority to decide the fate of a sick child.
Charlie's distraught parents had been trying to find a medical team that could look after their ailing boy in a hospice for several days so that they could bid farewell to him just days before his first birthday, which is due on Aug. 4.
SEE EARLIER: Charlie Gard's parents seek more time with sick son before he dies in a hospice
A judge had given the parents until noon to reach agreement with Great Ormond Street Hospital about spending more time in a hospice, but no compromise was reached so a judge ruled that Charlie's artificial ventilation should be turned off.
"It is not in Charlie's best interests for artificial ventilation to continue to be provided to him and it is therefore lawful and in his best interests for it to be withdrawn," judge Nicholas Francis said in an order.
Francis ruled that Charlie be transferred to a hospice and that his ventilation be withdrawn, according to a copy of the order seen by Reuters.
He ruled that the name of the hospice and details in a confidential annex about the arrangements for Charlie's death should not be published.
Charlie suffers from an extremely rare genetic condition causing progressive brain damage and muscle weakness. A ventilator keeps him alive. He cannot move his arms or legs, and cannot see, hear or swallow. His eyelids cannot stay open.
After reluctantly accepting that there was no hope for Charlie, his parents, Connie Yates and Chris Gard, had sought to take their son home to die.
But Great Ormond Street Hospital, where Charlie is being treated, said that would not be possible due to the invasive ventilation equipment needed to keep Charlie alive.
His parents then tried to find an intensive care doctor to oversee a plan that would allow Charlie to be ventilated in a hospice for several days.
A lawyer for Charlie's court-appointed guardian had told the High Court that no hospice could provide care for intensively ventilated children for a long time, so the parents' wish to spend several days with him could not be fulfilled.
The tragedy for Charlie and his family snowballed into a global debate, partly fueled by social media, about the ethical dilemma of whether parents, doctors or the state should decide Charlie's fate.
Such was the prominence of the case that it even drew comment from U.S. President Donald Trump and Pope Francis.
Charlie's parents fundamentally believed only they had the right to decide what medical treatment Charlie received, prompting a battle with Great Ormond Street Hospital, one of the world's most prestigious children's hospitals.
At one point on Wednesday, Yates shouted in court, apparently at Charlie's guardian: "What if it was your child? I hope you are happy with yourself." She then left the courtroom in tears.
Charlie's parents had wanted to take him to the United States to undergo an experimental treatment never before tried on anyone with his condition, against the advice of Great Ormond Street doctors.
Britain's courts, backed by the European Court of Human Rights, refused permission, saying it would prolong his suffering without any realistic prospect of helping him.
Charlie, who suffers from an extremely rare inherited mitochondrial disease called infantile onset encephalomyopathic mitochondrial DNA depletion syndrome, started having seizures before Christmas and his clinicians concluded that he had suffered irreversible brain damage by early this year. (Additional reporting by Fanny Potkin and Alistair Smout; Editing by Gareth Jones)