Charlie Gard is an 8 month old in the United Kingdom who has been fighting for his life against a rare disease.

His parents, Connie Yates and Chris Gard, wanted to keep him on life support and transport him to the United States in order to try an experimental treatment.

But on Tuesday, a High Court judge ruled that it was in the child's best interest for doctors to withdraw life support from Charlie and place him strictly on palliative care, in spite of his parents' wishes.

In his decision, Justice Francis praised Charlie's parents for "their absolute dedication to their wonderful boy, from the day that he was born," but ultimately ruled that it was in the child's best interest to withdraw life support.

"Some people may ask why the court has any function in this process; why can the parents not make this decision on their own?" Francis wrote.

"The answer is that, although the parents have parental responsibility, overriding control is vested in the court exercising its independent and objective judgment in the child's best interests. The Great Ormond Street Hospital has made an application and it is my duty to rule on it, given that the parents and the hospital cannot agree on the best way forward."

Charlie has a rare disorder called mitochondrial depletion syndrome which causes progressive muscle weakness, believed to affect fewer than 20 children worldwide. He has suffered significant brain damage due to the disease and is currently fed through a tube, breathes with an artificial ventilator, and is unable to move.

Hospital experts from Great Ormond Street Hospital (GOSH) argued in court that long-term life support should be withdrawn from Charlie because his quality of life was "so poor". Charlie's state-appointed counsel argued that the treatments available in the United States were only experimental and that long-term life support would only "prolong the process of dying" for Charlie.

However, Charlie's parents' legal representative argued that traveling to the U.S. for treatments would not have cause Charlie significant suffering or harm and could have given him another chance. She also argued that the parent's wishes should carry "great weight" in the decision.

Yates, Charlie's mother, previously told the BBC: "We just want to have our chance. It would never be a cure but it could help him live. If it saves him, amazing. I want to save others. Even if Charlie doesn't make it through this, I don't ever want another mum and their child to go through this."

Yates and Gard had set up a public GoFundMe account for Charlie's treatment in the U.S., which had raised nearly all of its £1.3 million ($1.6 million) goal.

However, the case was not about funding, but about what was in the best interest of Charlie, Francis said in his decision.

"There is unanimity among the experts from whom I have heard that nucleoside therapy cannot reverse structural brain damage. I dare say that medical science may benefit, objectively, from the experiment, but experimentation cannot be in Charlie's best interests unless there is a prospect of benefit for him," he said.

"It is with the heaviest of hearts, but with complete conviction for Charlie's best interests, that I find it is in Charlie's best interests that I accede to these applications and rule that GOSH may lawfully withdraw all treatment save for palliative care to permit Charlie to die with dignity."

Upon hearing the ruling, the BBC reports that Charlie's parents were visibly distressed, and that his father shouted "No" and burst into tears, as did other family members present.

The parents' representative said that they would be taking their time considering their next steps, but their first priority right now is spending time with Charlie. Charlie's life support will not be immediately withdrawn as Yates and Gard consider appealing the ruling.

(Story continues below)