(CNN) -- Jahi McMath, a 13-year-old girl on a ventilator who was declared brain dead by California doctors after tonsil surgery, was released from a hospital to her mother Sunday night -- apparently setting the stage for her family to transfer her to a facility willing to continue her care.
The move ends one chapter of a weekslong struggle between Children's Hospital & Research Center Oakland, which sought to remove Jahi from the ventilator after it and a judge concluded she was brain dead, and her relatives, who fought in court to keep her on life support and contended she showed signs of life.
The hospital released Jahi on Sunday to the Alameda County coroner, who then released her to her mother's custody, said David Durand, the hospital's chief of pediatrics. The hospital had previously said it needed the coroner's consent for the transfer because Jahi was legally dead.
Jahi, who was declared brain dead December 12 after post-surgery complications that her family says included severe bleeding and cardiac arrest, left the hospital Sunday accompanied by a critical care team. She was attached to a ventilator, but with no feeding tube in place.
An attorney for Jahi's family, Christopher Dolan, cheered the development. "She is safely out of Children's," he tweeted.
Although a New York facility says it's ready to care for Jahi, Dolan told reporters Sunday night that her destination won't be announced.
"We've had people make threats from around the country. It's sad that people act that way," Dolan said. "So for Jahi's safety and those around her, we will not be saying where she went or where she is."
But New Beginnings Community Center in Medford, New York, said it is an option.
"At this time we're named as the potential facility that Jahi and her family will be coming to, but we will know more details in a couple of hours, and we'll certainly be happy to let you know as we know," said Allyson Scerri, founder of New Beginnings.
On its website, the facility bills itself as an outpatient rehabilitation center for patients with traumatic brain injuries and says it plans to open a long-term care facility. According to her online biography posted on the facility's website, Scerri worked as a hair stylist for 25 years and founded the facility after her father sustained a traumatic brain injury in a motorcycle accident.
"We are aware of Jahi McMath's dire situation, and we are willing to open our outpatient facility to provide 24-hour care as an inpatient, long-term facility for Jahi with the required and appropriate medical staff that she depends upon," Scerri said in a letter included in court documents last week.
Jahi's case drew national attention and fueled debate as a fierce court battle unfolded between devastated family members fighting to keep her on a ventilator and doctors arguing she'd already died.
Family members say the eighth-grader was alert and talking after doctors removed her tonsils, adenoids and extra sinus tissue in a surgery at the Oakland hospital on December 9.
Doctors had recommended the surgery to treat pediatric obstructive sleep apnea, a condition which made her stop breathing in her sleep and caused other medical problems.
Before the surgery, Jahi said she was worried that she would never wake up, according to her uncle. She seemed fine after the surgery, but asked for a Popsicle because her throat hurt.
Not long afterward, something went terribly wrong. In an intensive care unit, the girl began bleeding profusely, the family said.
According to family members, Jahi went into cardiac arrest. Days later, she was declared brain dead.
Hospital officials have said privacy laws prevent them from discussing details of the case.
The court battle and the medical debate
The family and the hospital disagreed over whether to disconnect her from a ventilator, and the issue wound up in Alameda Superior Court.
In court documents and public comments, the hospital maintained that there's no doubt that McMath is brain dead, describing the condition as irreversible.
"No amount of prayer, no amount of hope, no amount of any type of medical procedure will bring her back," Children's Hospital Oakland spokesman Sam Singer said last month. "The medical situation here in this case is that Jahi McMath died several weeks ago."
A judge on December 23 appointed Dr. Paul Fisher, chief of pediatric neurology at Stanford Children's Hospital, to evaluate Jahi.
Fisher concluded the next day that she met the criteria for brain death. According to a court filing, Fisher found that the girl's pupils were fully dilated and unresponsive to light and that she did not respond to a variety of intense stimuli.
His report also says Jahi showed no sign of breathing on her own when a ventilator was removed: "Patient failed apnea test." The report says her heart was beating only because of the mechanical ventilator.
In addition, an imaging test showed no blood flow to Jahi's brain, while another showed no sign of electrical activity.
Fisher's conclusion: "Overall, unfortunate circumstances in 13-year-old with known, irreversible brain injury and now complete absence of cerebral function and complete absence of brainstem function, child meets all criteria for brain death, by professional societies and state of California."
After seeing Fisher's report, Alameda Superior Court Judge Evelio Grillo concluded on December 24 that Jahi was brain dead. But Grillo twice ruled that the hospital had to hold off on disconnecting Jahi from life support, ultimately giving the family and the facility until January 7 to come to a resolution.
The Alameda County coroner issued a death certificate for Jahi on Friday, listing December 12 as the date of death. The certificate still needed to be accepted by the health department to become official.
Medical ethicists, meanwhile, say the high-profile case fuels a misperception: that "brain death" is somehow not as final as cardiac death, even though, by definition, it is. The case is "giving the impression that dead people can come back to life," Arthur Caplan, director of the Division of Medical Ethics at NYU Langone Medical Center, told CNN last month.
Family members say they've seen reason for hope
Jahi's family members maintain that they're hoping for a miracle and want her care to continue elsewhere.
Her mother told CNN last month that she'd seen improvements, including indications from a hospital monitor that she said suggest her daughter was trying to breathe on her own.
The girl's uncle, Omari Sealey, told reporters last week that Jahi moves when her mother speaks and touches her. Sealey also said that a pediatrician has seen Jahi and has sworn she is not dead.
When asked about the girl's possible movement, Singer, the hospital spokesman, said he would not comment directly on any claims the family makes, citing privacy laws. However, Singer said it is "quite common" for the muscles of brain dead patients to move, stressing it's "not a sign of life."
So far the family has raised more than $50,000 on GoFundMe.com to move her. According to the site, more than 1,300 people have donated money in 10 days.
"We're very grateful, very proud," said Sealey, Jahi's uncle. "We want to thank everyone that supported us, everyone that stood in our corner, everyone that prayed for us, everyone that helped donate to make this possible. Without you guys, none of this would be possible."
Scerri of New Beginnings told CNN on Sunday that the girl just needs to be given a chance to recover.
"Her brain needs time to heal. It's a new injury," Scerri said. "We believe in life after injury. All of us here at New Beginnings have firsthand experience because we have a loved one that was in the same situation as Jahi."
Dolan said moving Jahi to a new care facility is critical to her recovery.
"We're very pleased to announce that Jahi McMath has been taken from Children's Hospital and brought to a place where they will use her name instead of calling her a body, and where she can get to the starting line instead of where Children's has left her the past four weeks almost, at the finish line."
In releasing Jahi, the hospital said: "Our hearts go out to the family as they grieve for this sad situation and we wish them closure and peace."