LONDON -- Charlie Gard, the terminally ill British baby at the centre of a legal and ethical battle that attracted the attention of Pope Francis and U.S. President Donald Trump, died Friday. He was one week shy of his first birthday.

Charlie's parents fought for the right to take him to the United States for an experimental medical treatment for his rare genetic disease, mitochondrial depletion syndrome, which left him brain damaged and unable to breathe unaided. His case ended up in the courts when doctors opposed the plan, saying the untested therapy wouldn't help Charlie and might cause him to suffer.

A family spokeswoman, Alison Smith-Squire, confirmed Charlie's death on Friday, a day after a judge ordered that he be taken off a ventilator at the Great Ormond Street Hospital in London and moved to an undisclosed hospice for his final hours.

"Our beautiful little boy has gone, we're so proud of him," his mother, Connie Yates, said in a statement.

Charlie was seemingly healthy at birth but soon began to weaken. He was admitted to Great Ormond Street Hospital, Britain's premier children's hospital, when he was two months old and remained there until almost the end of his life.

His legal case became a flashpoint for debates on the rights of children and parents, on health-care funding, medical interventions, the responsibilities of hospitals and medical workers and the role of the state. It gained international attention last month when Pope Francis and President Trump expressed their support for Charlie and his family.

The intervention of two of the world's most powerful men made the case a worldwide talking point. Images of Charlie hooked to a tube while dozing peacefully in a star-flecked navy blue onesie graced websites, newspapers and television news programs.

The pope reacted quickly to the news of Charlie's death, tweeting late Friday "I entrust little Charlie to the Father and pray for his parents and all those who loved him."

U.S. Vice-President Mike Pence tweeted "Saddened to hear of the passing of Charlie Gard. Karen & I offer our prayers & condolences to his loving parents during this difficult time."

Charlie's parents raised more than 1.3 million pounds ($1.7 million) to pay for the experimental treatment they believed could prolong his life. But British courts consistently accepted the hospital's position, ruling that it was in Charlie's best interests that he be allowed to die.

After months of legal battles, High Court judge Nicholas Francis ruled Thursday that Charlie should be transferred to a hospice and taken off life support after his parents and the hospital failed to agree on an end-of-life care plan.

Under British law, it is common for courts to intervene when parents and doctors disagree on the treatment of a child. In such cases, the rights of the child take primacy over the parents' right to decide what's best for their offspring. The principle applies even in cases where parents have an alternative point of view, such as when religious beliefs prohibit blood transfusions.

The case made it all the way to Britain's Supreme Court as Charlie's parents refused to accept earlier rulings.

Offers of help for Charlie came from Dr. Michio Hirano, a neurology expert at New York's Columbia Medical Center, and from the Vatican's Bambino Gesu pediatric hospital. Both said an experimental treatment known as nucleoside therapy had a chance of helping Charlie.

Great Ormond Street Hospital disagreed. It said the proposed treatment had never been tried on someone with Charlie's condition and no tests had even been done on mice to see whether it would work on a patient like Charlie.

The case caught the attention of Trump and the pope in late June after the European Court of Human Rights refused to intervene. Their intervention triggered a surge of grassroots action, including a number of U.S. right-to-life activists who flew to London to support Charlie's parents.

Great Ormond Street soon reported that its doctors and nurses were receiving serious threats over the case. London police were called in to investigate.

On Friday night, the hospital offered its condolences to Charlie's family.

"Everyone at Great Ormond Street Hospital sends their heartfelt condolences to Charlie's parents and loved ones at this very sad time," the hospital said.

Medical ethicist Arthur Caplan said the Charlie Gard case shows how the medical profession is struggling to adjust to the age of social media, which puts the general public in the middle of decisions that in the past would have been private issues for doctors and the family.

"I do think that in an era of social media, it is possible to rally huge numbers of people to your cause," said Caplan, of New York University's Langone Medical Center. "The medical ethics have not caught up."

The heated commentary over Charlie prompted Judge Francis to criticize the effects of social media and those "who know almost nothing about this case but who feel entitled to express opinions."

In the end, the increased attention did little for Charlie.

His parents gave up their legal battle on Monday after scans showed that Charlie's muscles had deteriorated so much that the damage was irreversible.

"Mummy and Daddy love you so much Charlie, we always have and we always will and we are so sorry that we couldn't save you," his parents wrote when they announced their decision. "We had the chance but we weren't allowed to give you that chance.

"Sweet dreams baby. Sleep tight, our beautiful little boy."

Associated Press Writer Leonore Schick contributed to this story