Click HERE if you’re having trouble viewing the gallery on your mobile device.

OAKLAND — Jahi McMath’s tragic saga came to an end last week, but the legal battle between her family and the hospital they claim was responsible for her brain damage grew even more heated after her lawyers announced the Oakland teen had been removed from the machines that kept her breathing for nearly five years.

The decision could cost the family millions of dollars in their medical malpractice suit against UCSF Benioff Children’s Hospital Oakland and some doctors, experts say, because the cost of future medical care is a major factor in determining damages.

“I’m sure doctors were popping corks of champagne,” said Christopher Dolan, who represents Jahi’s family in its lawsuit. He pulled no punches in claiming the hospital has dragged out the legal case to outlast Jahi, whose story set off an international debate after her family refused to accept a diagnosis that she was brain dead after complications during nose and throat surgery in 2013.

.”They are finally now limited in what their financial exposure is,” Dolan said of the Oakland hospital.

But attorney Dick Carroll, who is representing the hospital, said he was “righteously indignant” over such accusations.

“I think that’s 100 percent baloney,” he said. “If you look at the legal record, it took them forever to do anything.”

Carroll said the new development saddened his clients.

“There’s sadness for the family. If there’s one thing overriding in this process it’s the effort the mom made in keeping the fight alive for that child and your heart goes out to her,” Carroll said.

On Thursday, Dolan announced Jahi was suffering from internal bleeding and kidney problems on June 22 when doctors in New Jersey removed her from machines that kept her breathing since 2013. Her family had moved her there — the only state where families can reject brain death diagnosis on religious grounds — to continue caring for their then-13-year-old daughter.

New Jersey issued a death certificate, five years after the family refused to accept California’s.

The medical malpractice suit, which has inched its way through Alameda County Superior Court, no longer will argue whether Jahi satisfies the neurological criteria for death.

“The value of the civil case is now a lot lower, because she will have no more future medical expenses,” said Thaddeus Pope, a law professor who has followed Jahi’s case closely. “Previously, those were projected to extend for many years … The lower case value means the case will probably settle. Hard to say for how much. It will probably be confidential.”

The question over whether Jahi was brain dead had yet to be resolved. So it still wasn’t clear if her family could proceed with a personal injury or wrongful death lawsuit. California caps wrongful death lawsuits at $250,000.

However, Dolan said the family is now contemplating a second suit seeking damages for medical expenses from the time of her December 2013 surgery until last week when she was taken off a ventilator. Even if the family won such an award, which could be more than $1 million, the state of New Jersey could place a lien on the money.

When the family moved Jahi to New Jersey it was able to get free Medicaid healthcare coverage, because the state still recognized her as alive.

It isn’t clear how much her care has cost.

Ironically, Dolan believes Jahi’s New Jersey death will provide him with his best evidence yet that she wasn’t technically brain dead.

Doland said the draft New Jersey death certificateisted the cause of death as bleeding due to liver failure and it also listed a brain injury caused by a lack of oxygen.

“Not brain dead, brain injured,” Dolan stressed.

Compare that, he said, to Jahi’s California death certificate declaring her brain dead, which was never signed by a doctor. Dolan said he would argue that the New Jersey death certificate should supersede the incomplete California one, which would mean Jahi did not die in California and her true death date was June 22, 2018.

Carroll said he has spoken to Dolan and he’s open to a possible settlement.

Either way, the four-year legal maze has left a lasting legacy regardless of the conclusion.

“When I started this case, there was no game plan, no pleading, no resource. Nothing to say what you can do if you had a declaration of brain death,” Dolan said.

Since then, Dolan said he has fielded more than a dozen inquiries from families, around the world, asking for help battling a brain death declaration.

“In each of the cases we were effective in stopping urgent unplugging,” Dolan said, adding that about 80 percent still, after taking some time, let their loved one die.

Numerous neurologists conducted tests and found Jahi was brain dead, however Dolan found doctors who determined she still had limited brain function that did not meet the criteria for brain death.

“The reason this case has always been fascinating … is because it’s the first case ever where someone correctly declared dead, arguably is no longer dead,” Pope said. “That’s never happened before … once you’re declared dead, you’re supposed to stay dead.

“The gap between legal death and medical death, they were exploiting that gap,” said Pope, and others are joining them. “It’s not as black and white of a diagnosis as it was previously thought and therefore you have people asking: ‘Why do you get to say when my child is dead?’ “