California’s largest utility, Pacific Gas & Electric, was burned by the courts in an attempt to reduce its liabilities from wildfires in 2017 and 2018 linked to its faulty electrical grid on Wednesday, the San Francisco Chronicle reported.

PG&E declared it was filing for bankruptcy earlier this year after those fires resulted in dozens of deaths, the destruction of thousands of homes, and legal liabilities exceeding $20-30 billion. According to the Associated Press, the utility’s lawyers failed to convince U.S. Bankruptcy Judge Dennis Montali to reduce its liability for the fires, with Montali upholding that the state doctrine of “inverse condemnation” applied.

Condemnation is when the government compensates property owners for seizing property, such as when it claims a holding under eminent domain to build a road. In California, inverse condemnation allows property owners to claim that utilities destroyed their property in the course of providing a public service, regardless of whether they were negligent.

The AP reported that California utilities had long opposed the law but it never posed an existential threat to their business model until recently, as it allowed utilities to shield shareholders from damages by passing the costs along to customers in the form of higher rates. That changed in 2017, when California’s Public Utilities Commission finding that San Diego Gas & Electric could not pass along inverse condemnation liabilities to customers because it had acted negligently in maintaining its power lines. That significantly increased the amount of costs utility companies themselves would have to bear and is commonly cited as a major cause of PG&E’s bankruptcy filing.

According to the Chronicle, PG&E’s argument that inverse condemnation laws were written to apply to government entities, not investor-owned companies, failed to convince Montali. The judge noted that PG&E would still be able to pass on the costs to customers if it showed the damages were not its fault, which the AP wrote “seemed to stump PG&E’s lawyers.”

“The California Constitution provides that private property may be taken or damaged for a public use as long as just compensation is paid to the owner,” Montali wrote in the ruling. “This section does not mention liable parties, cost recovery, or socialization of costs. In short, the California Constitution imposes strict liability in favor of the owner of property that has been taken or damaged through a public use or purpose and does not concern itself with the rights or liabilities of (who) or what did the damage.”

PG&E failed to show a utility had “ever been denied cost recovery under this principle when they have been found prudent,” Montali added.

According to Bloomberg, even if PG&E had the law thrown out it would still be directly exposed to billions of dollars in damages in civil lawsuits claiming negligence on its part.

The fires that have burned millions of acres of California land in recent years are closely linked to climate change, though the Wall Street Journal reported earlier this year that state investigators had linked some 1,500 of the blazes to faulty PG&E equipment. PG&E has been forced to enact massive rolling blackouts throughout the state during predicted times of high wind, which could cause electrical lines to snap. The company’s CEO, Bill Johnson, recently admitted at a California Public Utilities Commission (where the company was lambasted for its lack of planning around the outages) that the blackouts could last a decade as it works to reduce fire risk.