They also accepted that their desire for him to go home for his last days was not possible, their lawyer said.

The case captured the attention of Pope Francis and President Trump, and underlined the perils of what can happen when a hospital and the parents of a sick child differ fundamentally on treatment and care, and communication between the parties breaks down.

The question of when and where he should die — and how long he should be kept alive — became another source of acrimony between the parents and the institution responsible for his care, Great Ormond Street Hospital.

The parents had said that their last wish was to spend several days at home with Charlie before his life support was removed. But Great Ormond Street Hospital said that the “invasive ventilation” over several days required a team of intensive care specialists and that the Gard family home was unlikely to be able to meet his needs.

It also said the ventilator would not fit through the family’s front door in West London.

The hospital said that the plan to end his life “must be safe, it must spare Charlie all pain, and it must protect his dignity.” It suggested that he should die in a hospice that would offer the parents privacy in their child’s final moments.

Grant Armstrong, a lawyer for the parents, initially accused the hospital of “creating obstacles.” On Wednesday, however, he said that the family had agreed that Charlie would move to a hospice and had found a team of doctors and nurses willing to care for him until life support was removed after about a week.

But Great Ormond Street Hospital said that arrangement was not feasible amid concerns that the doctor organizing the care was not a pediatric intensive care specialist.