This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

A federal bankruptcy judge on Tuesday approved two Pacific Gas & Electric settlements totaling $24.5 billion to help pay the losses suffered by homeowners, businesses and insurers in the aftermath of catastrophic Northern California wildfires that sent the nation’s largest utility into a financial morass.

The decision by U.S. Bankruptcy Judge Dennis Montali at the end of a five-hour court hearing bolsters PG&E’s chances of following its preferred path for getting out of bankruptcy by a make-or-break June 30 deadline. Montali also handed the utility another victory by rejecting attempts by a competing group to offer an alternative proposal to steer PG&E out of bankruptcy instead of the company’s plan.

Despite the strides made Tuesday, PG&E still faces huge obstacles.

The most significant is California Gavin Newsom’s recent conclusion that PG&E’s plan to emerge from bankruptcy doesn’t comply with state law, which the company must do to qualify for coverage in a wildfire fund approved by the California Legislature.

The company’s plan relies on coverage from the fund created last summer to insulate PG&E and other utilities from losses caused by future wildfires that could be ignited by their transmission lines. That specter looms large, given that PG&E’s outdated equipment and managerial negligence has been blamed for the series of deadly wildfires that raged through Northern California in 2017 and 2018, killing dozens.

PG&E sought refuge in bankruptcy in January as it grappled with $36 billion in claims from people who lost homes, businesses and family members in those fires. Those claims will now be settled as part of a $13.5 billion deal that PG&E worked out earlier this month with lawyers representing uninsured and underinsured victims of the past fires. Insurers had been threatening to try to recover the roughly $20 billion in policyholder claims that they believe they will end up paying for losses in those fires. PG&E settled with the insurers for $11 billion.

Newsom’s rejection of PG&E’s current plan late last week had threatened to blow up PG&E’s deal with the fire victims because it initially required his approval. But the company and attorneys for the fire victims got around that problem by revising their agreement late Monday so the settlement no longer relied on Newsom’s blessing.

PG&E must still find a way to gain Newsom’s support for its overall plan, but the judge’s approval of the fire victims settlement buys the company more time to win him over. Among other things, Newsom is demanding PG&E replace its entire 14-member board of directors, including CEO Bill Johnson, and make it easier for state and local governments to launch a bid to take over the company and turn it into a customer-owned cooperative if it continues to operate in an unsafe or unreliable manner.

If the company can’t placate Newsom ahead of the June 30 bankruptcy deadline, the settlements with both the fire victims and insurers could still fall apart.

Nancy Mitchell, an attorney representing Newsom at Tuesday’s hearing, told Montali that PG&E seems determined to retool its plan to the governor’s satisfaction.

“They have been tremendous on getting the plan closer” to meet Newsom’s approval, she said. “We are not there.” She said ensuring the fire victims get paid for their losses is one of the governor’s “north stars.”

PG&E considered Montali’s decision on the settlements “a crossroads in the case,” the utility’s lawyer, Stephen Karotkin, told Montali. Without the settlements, Karotkin warned that PG&E would have been stuck in a litigation quagmire that would have eliminated any hope the company had of getting out of bankruptcy next summer.

Several other key issues still have to be worked out, including how the trust for the fire victims will be managed and the process for submitting claims. Attorneys for the victims told Montali Tuesday they hope to have those details ironed out by Jan. 20.

It wasn’t all good new for PG&E on Tuesday, though. California regulators announced a proposed $1.7 billion settlement that will punish the utility for sparking the fires in 2017 and 2018. The terms will stick the utility’s shareholders with the responsibility for paying for the company’s efforts to provide “safe and reliable service.” It also figures to undercut PG&E’s profits while sparing the utility’s customers the indignity of further raising their prices for electricity, which already are among the highest in the U.S.

The agreement with the California Public Utilities Commission still needs Montali’s approval. Besides preventing PG&E from billing customers for recovering the $1.625 billion it expects to incur in legal costs from the fires, it requires the company to earmark an additional $50 million to improve operations.

The settlement comes after the commission found the utility failed to sufficiently identify dead and dying trees, remove brush and dead trees that can spark wildfires, failed to patrol and maintain its electrical systems and disposed of maintenance evidence needed in the investigations.

In another development Tuesday, Montali gave approval for another group of victims to move forward with a civil trial against PG&E to determine its liability in the December 2016 “Ghost Ship” warehouse fire in Oakland, California, that killed 36 people.

Montali ruled that their lawsuits against PG&E can proceed, with the caveat that any damages would be capped at the amount of coverage remaining from the utility’s 2016 insurance policies so the company won’t have to drain its depleted finances even further. Attorneys for the fire victims suggested in court that as much as $900 million could still be available under PG&E’s 2016 insurance policies.