Archie Battersbee, 12, suffered traumatic brain injuries after an incident at home in April and doctors and his family battled in court over his continuing life-support treatment. He died on 6 August.
This is how the story unfolded.
Who was Archie Battersbee?
Archie was described as a "born fighter" by his mum Hollie Dance.
Before his accident, he was an active young boy who took part in mixed martial arts and gymnastics, his family said.
That interest in mixed martial arts also spurred an interest in Christianity two years ago, after he saw other fighters praying before fights, they added.
On 7 April, his mother found him unconscious after an incident at their home in Southend, Essex. She believed he had been taking part in an online challenge.
Why was his case heard at court?
After being transferred to the Royal London Hospital in east London, run by Barts Health NHS Trust, doctors told Archie's family they believed his brain damage was so significant that he may be brain stem dead.
Doctors asked to conduct a brain stem death test, but Archie's family denied consent, leading the trust to bring a case at the High Court in London for permission for the test to be carried out.
In subsequent hearings, lawyers representing the trust had asked the judge to decide what moves were in Archie's best interests.
The brain stem test was unable to be conducted and since further hearings have taken place to determine whether life-sustaining treatment should continue.
At the end of a hearing on 13 June, the judge ruled that Archie had died on the day of his MRI scan on 31 May and his life support treatment could stop.
Archie's parents won an appeal for the case to be reconsidered on 29 June, and a new hearing, presided over by a different judge, to determine what was in Archie's best interests, took place on 11 July.
On 15 July, Mr Justice Hayden issued his ruling that it was in Archie's best interests for life support to end saying further treatment was "futile".
An application to the Court of Appeal to overturn the ruling was rejected and the Supreme Court also refused to intervene.
Archie's family made an application to the United Nations Committee on the Rights of Persons With Disabilities, which then asked the UK government to delay the withdrawal of treatment while itconsideredthe case.
His familysaid the committee has a protocol that allows individuals and families to "make complaints about violations of disabled people's rights".
Health Secretary Steven Barclay asked the courts for an urgent hearing to review the case but three Court of Appeal Justices found the convention relied upon by the committee did not form part of UK law and so upheld the original decision that life-sustaining treatment should stop.
A further application to appeal that decision was made to the Supreme Court but was rejected.
Archie's family also sought permission from the High Court to allow them to move Archie to a hospice but a judge ruled it was not in Archie's best interests to be moved.
What else did Archie's family say?
Archie's parents, Hollie Dance and Paul Battersbee, argued that their son needed more time to heal.
They had also argued that their and Archie's religious beliefs should be given more consideration by medics and the court.
Supported by the Christian Legal Centre campaigning organisation, the family said they had seen signs of life from Archie and that doctors had not listened to their concerns.
Ms Dancehad said she believed her son needed "more time" to recover.
Speaking after the second High Court ruling was given, Ms Dance called it a "crushing blow".
"We disagree with the idea of dignity in death. Enforcing it on us and hastening his death for that purpose is profoundly cruel," she said.
"It is for God to decide what should happen to Archie, including if, when and how he should die.
"As long as Archie is fighting for his life, I cannot betray him."
She had saidshe was "living every parent's worst nightmare" and vowed not to give up.
What did the doctors say?
Doctors treating Archie had told the High Court that it was "highly likely" he was "brain stem dead" following scan results and had asked the court to consider ordering that his life support should be stopped.
During one hearing, specialists said tests had shown no "discernible" brain activity and that parts of his brain were showing "significant areas of tissue necrosis".
A previous High Court ruling heard that Archie's "every bodily function" was maintained by artificial means.
At a Court of Appeal hearing on 1 August Sir Andrew McFarlane, President of the High Court Family Division, summarised Archie's condition based on the medical evidence.
He said: "In short his system, his organs and, ultimately, his heart are in the process of closing down."
It was lawyers representing the trust who originally asked the High Court to decide what next step was in Archie's best interests.
Following the latest appeal loss by the family, Alistair Chesser, chief medical officer at Barts Health NHS Trust, had said: "Our deepest sympathies remain with Archie's family.
"As directed by the courts, we will now work with the family to prepare for the withdrawal of treatment."