SAN FRANCISCO — The family of a 13-year-old girl who was declared brain-dead after her sleep apnea operation went awry filed a medical malpractice lawsuit on Tuesday detailing the emotional, chaotic hospital drama that included a court battle over ending life support.

Jahi McMath's family is seeking unspecified damages from UCSF Benioff Children's Hospital in Oakland in the case filed in Alameda County Superior Court.

They claim the hospital botched Jahi's operation on Dec. 9, 2013; didn't respond properly and promptly to dramatic signs of post-operative distress; and badgered the family to end life support and donate Jahi's organs, even though her heart kept beating.

Jahi was declared brain-dead on Dec. 12, 2013, after three different medical experts agreed the teen showed no brain activity.

During a court fight, the hospital kept Jahi on life support long enough for the family to move her to an undisclosed facility in New Jersey, which allows families to reject a declaration of brain death on religious grounds and lets patients remain connected to ventilators. She remains at the facility.

The hospital declined to comment on the lawsuit.

"Our hearts go out to the McMath family," hospital spokeswoman Melinda Krigel said. "It is our policy not to comment on pending litigation."

The lawsuit alleges that the hospital's first misstep was recommending a "complex and risky" operation to cure Jahi's sleep apnea rather than first trying a safer treatment.

Then, during the surgery, a doctor noted that Jahi had a condition that could result in post-operative bleeding but failed to notify nurses and others responsible for her care after surgery, the suit states.

Jahi's parents say they were given conflicting advice shortly after surgery when they reported their daughter was coughing up blood.

One nurse gave them a suction device to clear blood from Jahi's mouth, and another nurse told the parents not to suction the blood, according to the lawsuit.

Nurses and doctors are accused of failing to react quickly enough to the bleeding, which the lawsuit says led to Jahi going into cardiac arrest and suffering brain death.

The family alleges that hospital administrators failed to explain what happened to Jahi, and that that Dr. David Duran, the hospital's pediatric chief, slammed his fist on a table and said, "'what is it that you don't understand? She is dead, dead, dead, dead.'"