In a last-ditch effort to avoid bankruptcy, Pacific Gas and Electric Corporation (PG&E) has reached a $24.5 billion settlement with the victims and insurance companies affected by multiple wildfires in Northern California, including the Camp Fire (2018), the Tubbs Fire (2017), the Ghost Ship Fire (2016), the Butte Fire (2015), and several more. In the settlement, the energy company acknowledged that their equipment and history of shoddy repair-work ignited these disastrous fires.

U.S. Bankruptcy Judge Dennis Montali listened to several hours of discussion and factors in a hearing on Tuesday, December 17, before approving the settlement. He also stipulated that it does not prevent the company from being brought to further trial on the matter.

“Today marks an important milestone⁠—the Bankruptcy Court has approved our settlement agreements resolving all major wildfire claims,” said PG&E in a statement to NPR. “This brings us one significant step closer to getting victims paid so they can rebuild their lives.”

Some of the victims can’t rebuild their lives. An estimated 85 people died in the Camp Fire alone, which was started by a faulty electric transmission line caused by a part on a high voltage tower that the company knew was broken. Additionally, 36 died in the Ghost Ship concert fire, 22 in the Tubbs fire, and 2 in the Butte Fire.

$13.5 billion of the settlement is meant for the victims and families of those affected by the fires, and $11 billion to compensate insurers for paid-out claims. Another recent, separate settlement also saw PG&E pay $1.65 billion to state energy regulators in fines, and specifically prevented the company from passing that cost on to their customers in raised rates.

PG&E is in a hurry to have all of this settled, because they need their bankruptcy to be complete before June, when a state-funded wildfire fund will become available to utilities to help prevent this from happening again. While the judge has approved the settlement, it is still subject to public and official review, and the approval of a higher state court.