The 10-year-old Prince George’s County boy who was stranded in a Children’s National Medical Center psychiatric ward for eight weeks has been moved to a long-term-care facility near Philadelphia.

At a hearing Thursday before D.C. Superior Court Senior Judge Eugene N. Hamilton, an attorney for Children’s Hospital said the hospital paid for an ambulance to take the boy — along with his medication and paperwork — to the facility. His mother accompanied him, according to Rhea Yo, the boy’s court-appointed attorney.

Hamilton repeatedly asked how the boy, who had been in the hospital since Sept. 15, took to the move.

He wanted to go home, Yo said, but his mother and hospital workers explained that he needed to go to Pennsylvania.

The boy primarily wanted “a change,” said Kenneth Rosenau, the hospital’s attorney.

“I guess that’s all we can do at the moment,” Hamilton said.

At the hearing, the hospital asked Hamilton to dismiss the civil lawsuit it had filed Sept. 28 against the boy’s parents and Prince George’s County. The paperwork to drop the case, which sought the boy’s removal, will be filed Monday, according to the hospital.

The Washington Post was permitted to cover the hearing on the condition that the boy and his family not be identified.

The boy was admitted Sept. 15 after stabbing a relative and threatening suicide, court papers say.

The hospital later filed the suit, saying it could no longer provide the care he needed.

The boy’s mother said she could not care for him, and his father does not have custody rights. County authorities, meanwhile, would not take him, saying they had not found an appropriate facility for the child.

That set off legal wrangling among the hospital, the boy’s parents and Prince George’s about where he would go and who would pay for his care. Eventually, Maryland officials said Medicaid would pay the costs.

After the hearing, the hospital offered its reasoning for filing the lawsuit: “As a last resort, Children’s pursued legal action to do the right thing for this child, who deserved to be treated through a structured outpatient program or residential placement — not in an acute psychiatric care unit.”