Updated

A California judge has ordered that a 13-year-old Northern California girl is to be taken off life support after being declared brain dead as a result of complications following a tonsillectomy.

Alameda County Superior Court Judge Evelio Grillo issued the order Tuesday but gave Jahi McMath's family until 5 p.m. Dec. 30 to file an appeal. She will stay on life support until then.

Grillo issued the order after a Stanford doctor testified that Jahi is brain dead. Dr. Paul Graham Fisher's evaluation was the second to reach that conclusion.

McMath's family, who has said it believes she is still alive, wants to keep her connected to a breathing machine.

Grillo called McMath to be independently examined by Fisher, who is the chief of child neurology at Stanford University School of Medicine.

Jahi experienced complications following a tonsillectomy earlier this month at the hospital. Doctors declared her brain dead December 12 and informed McMath's family of their plans to switch off the ventilator that was helping Jahi breathe and disconnect her feeding tube. McMath's family have obtained a temporary restraining order against the hospital and hope to keep her hooked up to a respirator and eventually move her to another facility.

“This fight is going to go on until Jahi wakes up or we can get her to another facility. But we're not going to allow anyone to pull the plug on this girl,” Omari Sealey, McMath's uncle, told KTVU-TV after the Monday ruling.

"It's wrong for someone who made mistakes on your child to just call the coroner ... and not respect the family's feeling or rights," Sandra Chatman, Jahi's grandmother, said in the hallway outside the courtroom.

The family's attorney also asked Judge Grillo to allow a third evaluation by Paul Byrne, a pediatric professor at the University of Toledo. The hospital's attorney objected to Byrne, saying he is not a pediatric neurologist.

The judge was expected to take up the request to use Byrne, and another hearing was scheduled for Tuesday morning, Christmas Eve.

Byrne is the co-editor of the 2001 book "Beyond Brain Death," which presents a variety of arguments against using brain-based criteria for declaring a person dead.

In a phone interview with the Associated Press, Byrne said he could not comment in detail because he had not seen any of Jahi's medical records. But the fact that her ventilator is still functioning properly is a sign that she is alive, he said.

"The ventilator won't work on a corpse," he added. "In a corpse, the ventilator pushes the air in, but it won't come out. Just the living person pushes the air out."

Jahi's family says the girl bled profusely after a tonsillectomy and then went into cardiac arrest before being declared brain dead.

Outside the courtroom, Dr. David Durand, chief of pediatrics at Children's, said that staff have the "deepest sympathy" for the family, but that Jahi is brain dead.

"The ventilator cannot reverse the brain death that has occurred and it would be wrong to give false hope that Jahi will ever come back to life," he said.

Durand said Jahi's surgery was "very complex," not simply a tonsillectomy.

"It was much more complicated than a tonsillectomy," Durand said. He refused to elaborate, citing health care privacy laws.

Arthur L. Caplan, who leads the Division of Medical Ethics at NYU Langone Medical Center and is not involved in Jahi's case, told the Associated Press that keeping Jahi on a ventilator is also likely to cost thousands of dollars a day, he continued, and because she has been declared brain dead, is unlikely to be covered by health insurance.

Christopher Dolan, the family's attorney, vowed to keep Jahi hooked to the ventilator through Christmas, saying he would file an appeal if the judge orders her removed from the machine on Tuesday.

"I am confident she'll live through Christmas," a visibly weary Dolan said after the hearing. Dolan said he is working the case for free after the family reached out for help a week earlier.

Given the very public battle over Jahi's treatment, the judge pleaded with attorneys on both sides to continue speaking with each other and the family to help prepare for his eventual final order.

"This is a very, very charged case. The stakes are very high because there's a young girl involved," Grillo said.

The Associated Press contributed to this report. 

Cick for more from KTVU.com