Not his parents' home, as they had wanted.
But they disagreed over the detail of care plans.
This choice was criticized by doctors at the Great Ormond Street Hospital, who care for the baby, argüant that it was not feasible to provide treatment in the home of the parents.
Judge Nicholas Francis issued the order after the boy's parents Chris Gard and Connie Yates gave up their fight for him to die at home, saying "this has been a very very hard decision to reach".
The pair originally wanted to take the baby back home for his final few days, but settled on transferring him to a hospice. The hospital recommended a hospice, but said that life support would be withdrawn after a few hours, contrary to Chris and Connie's wishes of wanting days with their son.
The parents and the Great Ormond Street Hospital's (GOSH) lawyers did not reach any agreement.
He said the couple felt there was a "brutality" in taking Charlie to a hospice.
In May, the Court of Appeal upheld the ruling, and judges for the European Court of Human Rights declined to intervene in June.
"What if it was your child", Connie Yates shouted at the hearing before storming out in tears.
Charlie's mother, Connie Yates, became distressed as the judge made his decision.
Charlie requires invasive ventilation to breathe and can not see, hear or swallow. They gave up their fight on Monday, acknowledging that the window of opportunity to help him had closed.
The case caught the attention of US President Donald Trump and Pope Francis and the cause garnered widespread grassroots support.
It has instead offered a hospice space for Charlie.
The Great Ormond Street doctors said it would not help and would only prolong the baby's suffering.
While even several Catholic ethicists remain divided on how to care for Charlie, some secular ethicists like Peter Singer (who consistently argues against the Catholic ethos) have argued positively for this child to receive medical treatment.
But Charlie's godfather, James Evers, last night expressed anger at what he called GOSH's "arduous" conditions, such as having one of their intensive care specialists at Charlie's side throughout.