But the judge says there is a condition: the girl's mother must assume full responsibility for the move, including the possibility that her daughter could go into cardiac arrest.
Jahi McMath has been on a ventilator for nearly a month at Children's Hospital Oakland. The hospital has declared McMath brain dead and wants to disconnect her from the ventilator.
But her mother, Nailah Winkfield, has been fighting to have the hospital insert breathing and feeding tubes so she can be transferred to a different facility.
McMath's family says a New York facility has shown interest in caring for the girl.
The Associated Press contributed to this report.