It has been a heartbreaking legal battle that has captured international attention and drawn offers of support from Donald Trump and the Pope.
Now, Charlie Gard has died after his life-support was withdrawn soon after he was moved to a hospice, denying his parents their "final wish" for him to spend his final hours at home.
The little boy's parents, Chris Gard and Connie Yates, had asked for more time with their son after he was transferred from Great Ormond Street Hospital, but High Court judge Mr Justice Francis said doctors could stop providing treatment shortly after 11-month-old arrived at the hospice.
Here is everything you need to know about the case.
Who is Charlie Gard?
Charlie is a 10-month old patient in intensive care at Great Ormond Street Hospital (GOSH) in London.
On August 4, 2016, he was born a "perfectly healthy" baby at full term and at a "healthy weight". After about a month, however, Charlie's parents, Chris Gard and Connie Yates, noticed that he was less able to lift his head and support himself than other babies of a similar age.
Doctors discovered he had a rare inherited disease - infantile onset encephalomyopathy mitochondrial DNA depletion syndrome (MDDS).
The condition causes progressive muscle weakness and brain damage.
In October, after he had became lethargic and his breathing shallow, he was transferred to the Great Ormond Street Hospital.
Why was there a legal fight?
Charlie's parents wanted to take him to see specialists in the USA, who had offered an experimental therapy called nucleoside.
A crowdfunding page was set up in January to help finance the therapy.
But doctors at GOSH concluded that the experimental treatment, which is not designed to be curative, would not improve Charlie’s quality of life.
When parents do not agree about a child’s future treatment, it is standard legal process to ask the courts to make a decision. This is what happened in Charlie’s case.
What were the stages of the legal battle?
March 3: Great Ormond Street bosses asked Mr Justice Francis to rule that life support treatment should stop.
The judge was told that Charlie could only breathe through a ventilator and was fed through a tube.
April 11: Mr Justice Francis said doctors could stop providing life-support treatment after analysing the case at a hearing in the Family Division of the High Court in London
He concluded that life-support treatment should end and said a move to a palliative care regime would be in Charlie's best interests.
May 3: Charlie's parents then asked Court of Appeal judges to consider the case.
May 23: After analysing the case, three Court of Appeal judges dismissed the couple's appeal two days later.
June 8: Charlie's parents then lost their fight in the Supreme Court. Charlie's mother broke down in tears and screamed as justices announced their decision and was led from the court by lawyers.
June 20: Judges in the European Court of Human Rights started to analyse the case after lawyers representing Charlie's parents make written submissions.
A European Court of Human Rights spokeswoman said the case would get "priority". "In light of the exceptional circumstances of this case, the court has already accorded it priority and will treat the application with the utmost urgency," she added.
June 27: On Tuesday, European court judges refused to intervene. A Great Ormond Street spokeswoman said the European Court decision marked "the end" of a "difficult process".
She said there would be "no rush" to change Charlie's care and said there would be "careful planning and discussion".
July 10: Charlie's parents return to the High Court and ask Mr Justice Francis to carry out a fresh analysis of the case. Mr Justice Francis gives them less than 48 hours to prove an experimental treatment works.
July 24: Charlie's parents withdraw their request to change the original court order.
The baby will have his life support switched off in the next few days.
Why was the case back in court?
Charlie inherited the faulty RRM2B gene from his parents, affecting the cells responsible for energy production and respiration and leaving him unable to move or breathe without a ventilator.
GOSH describes experimental nucleoside therapies as "unjustified" and the treatment is not a cure.
The hospital's decision to go back into the courtroom came after two international healthcare facilities and their researchers contacted them to say they have "fresh evidence about their proposed experimental treatment".
Charlie's parents have now decided to end their legal battle.
Grant Armstrong, the parents lawyer, told the court: "for Charlie it is too late."
What did Charlie's parents argue?
Richard Gordon QC, who led Charlie's parents' legal team, had told Court of Appeal judges that the case raised "very serious legal issues".
"They wish to exhaust all possible options," Mr Gordon said in a written outline of Charlie's parents' case.
"They don't want to look back and think 'what if?'. This court should not stand in the way of their only remaining hope."
Mr Gordon suggested that Charlie might be being unlawfully detained and denied his right to liberty.
He said judges should not interfere with parents' exercise of parental rights.
Lawyers, who represented Charlie's parents for free, said Mr Justice Francis had not given enough weight to Charlie's human right to life.
They said there was no risk the proposed therapy in the US would cause Charlie "significant harm".
However, Miss Yates and Mr Gard have now acknowledged that the therapy could not help their son get better. Their lawyer, Grant Armstrong, told the court that the delay in offering treatment to Charlie had meant he had no prospect of getting better.
Mr Armstrong said damage to Charlie's muscle and tissue was irreversible.
"The parents' worst fears have been confirmed," he said
"It is now too late to treat Charlie."
What did GOSH argue?
Katie Gollop QC, who led Great Ormond Street's legal team, suggested that further treatment would leave Charlie in a "condition of existence".
She said therapy proposed in the USA was "experimental" and would not help Charlie.
"There is significant harm if what the parents want for Charlie comes into effect," she told appeal judges. "The significant harm is a condition of existence which is offering the child no benefit."
She added: "It is inhuman to permit that condition to continue."
Ms Gollop said nobody knew whether Charlie was in pain.
"Nobody knows because it is so very difficult because of the ravages of Charlie's condition," she said.
"He cannot see, he cannot hear, he cannot make a noise, he cannot move."
Interventions from Trump and the Vatican
While Ms Yates and Mr Gard said they have been boosted by support from US President Donald Trump and the Vatican, a leading expert has described interventions from high-profile figures as "unhelpful".
Professor Neena Modi, president of the Royal College of Paediatrics and Child Health said in an open letter that Charlie's situation is "heartbreaking" for his parents, and "difficult" for others including medical staff, but added that even well-meaning interventions from outsiders can be unhelpful.
If we can help little #CharlieGard, as per our friends in the U.K. and the Pope, we would be delighted to do so.— Donald J. Trump (@realDonaldTrump) July 3, 2017
The interest of the Pope and Mr Trump in Charlie's case has "saved his life so far", his mother has said.
Ms Yates told BBC Radio 4's Today programme on July 10: "Yeah, they have saved his life so far. It turned it into an international issue.
"There are a lot of people that are outraged by what is going on. We have got new evidence now so I hope the judge changes his mind."
She said that "sometimes parents are right in what they think" and it is not simply that they do not want to switch off life support.
She said the family had seven specialist doctors - two from the US, two from Italy, one from England and two from Spain - supporting them.
She added: "We expect that structural damage is irreversible, but I have yet to see something which tells me my son has irreversible structural brain damage."
The parents have now acknowledged that the therapy they were seeking could not help their son get better. Their lawyer said the couple felt that continuing their fight would cause Charlie pain.