SAN FRANCISCO — A federal bankruptcy court judge on Wednesday rejected Pacific Gas & Electric's latest attempt to change a California law requiring utilities to pay for the devastation from wildfires ignited by their electrical equipment.

The decision issued by U.S. Bankruptcy Judge Dennis Montali preserves a long-standing principle known as "inverse condemnation."

The century-old law helped drive the nation's largest utility into bankruptcy protection 10 months ago as it faced at least $20 billion in losses stemming from a series of deadly and destructive wildfires in 2017 and 2018.

PG&E didn't immediately respond to a request for comment.

The ruling is a victory for thousands of people who lost their homes and loved ones in the fires, as well as insurers trying to recover part of the roughly $16 billion they have already paid their policyholders.

In addition to using bankruptcy to reorganize its finances, PG&E hoped the process would enable it to shed the burden of inverse condemnation.

Although utilities never liked the law, it wasn't crippling until recently. That's because California's power regulators typically allowed profit-driven utilities to recoup their fire losses by raising their rates — effectively forcing their customers to bear the burden instead of their stockholders.

That changed two years ago when California's Public Utilities Commission rejected a request from San Diego Gas & Electric to pass along losses from a past fire to its customers. Regulators had determined the utility's negligence in protecting and upgrading its electrical system played a key role in the fires.

That raised the specter of California utilities having to shoulder all the costs of future wildfires at a time when the blazes are growing more frequent and destructive amid climate change.

The shift in the regulatory landscape has been even more jarring because PG&E and other utilities put off maintenance on aging electrical systems. Those past decisions can now be interpreted as poor management or outright negligence after PG&E's power grid was linked to several fires that destroyed thousands of homes and killed dozens of people.

With utilities no longer assured of passing along wildfire costs through higher rates, investors began to demand higher interest rates for the companies to borrow money. That, in turn, threatened to make it too expensive for PG&E to pay for the work to make its system safer and more reliable, which would hurt its 5 million customers in the long run.

PG&E also had tried to persuade the bankruptcy judge that the law was designed to serve as a "socialization of losses," so it should always be allowed to recover its wildfire costs through higher rates.

During court hearings on the issue, Montali repeatedly questioned whether a federal bankruptcy judge should tinker with a liability standard that California lawmakers reviewed last summer and allowed to stand.

He also pointed out that PG&E would still be allowed to pass along its costs from wildfires, as long as it could show it had done the work to properly maintain its power grid.

Montali asked in a court hearing whether there's any indication state regulators would punish a "prudent utility." That seemed to stump PG&E's lawyers.

PG&E could still appeal Montali's decision as part of its efforts to reduce its liability from past and future fires.

RELATED:

FREE ABC10 APP:

Download on the App StoreGet it on Google Play

Stay In the Know! Sign up now for ABC10's Daily Blend Newsletter

WATCH ALSO: PG&E CEO says utility wasn’t fully ready for California power outages

The head of PG&E told angry California lawmakers Monday that the nation’s largest electric utility wasn’t fully prepared for the effects of its power outages.