Southern California’s big utilities have reached a settlement that will see them, not customers, shoulder $775 million in final costs for the closure of the San Onofre nuclear power plant. The deal overrides a 2014 agreement masterminded by disgraced California Public Utilities Commission president Michael Peevey.

Wednesday’s settlement with the state’s Office of Ratepayer Advocates and a long list of community and consumer groups, led by San Diego-based Citizens Oversight, closes the book on a scandal-tainted episode. As one of his last acts as CPUC president, Peevey, the former CEO of San Onofre majority owner Southern California Edison, approved a 2014 deal that put $3.3 billion (or 70 percent of the closure’s $4.7 billion price tag) on ratepayers.

Shortly after, in early 2015, Peevey had his home raided as part of a state corruption investigation. The searches yielded emails detailing a 2013 meeting between Peevey and SCE executives at a hotel in Warsaw, Poland, shortly before the closure plan was unveiled. Peevey may or may not remain under criminal investigation, according to the latest reports, and the CPUC fined SCE $16.7 million in 2016 for violating ex parte communications rules related to the meeting.

Meanwhile, a 2014 lawsuit filed by former San Diego city attorney Michael Aguirre accused SCE and the CPUC of crafting a deal that amounted to an illegal taking of property from the utilities’ ratepayers. That lawsuit was taken up by the U.S. Court of Appeals for the Ninth Circuit in 2016, pushing the CPUC to open the plan to renegotiation. This week’s settlement comes just a month before the lawsuit was set for its first hearing.

This unusual, if not unique, set of circumstances made it all but certain that SCE, which owns 80 percent of the plant, and San Diego Gas & Electric, which is a minority shareholder, would be taking on a significant share of the remaining ratepayer costs. San Onofre underwent an emergency shutdown in 2012 and was officially shuttered in 2013.

This week’s settlement simplifies the matter by declaring that both utilities will “cease rate recovery” for any more costs associated with the power plant, or $775 million, if the CPUC accepts the settlement’s valuation as of December 2017. SCE’s remaining “regulatory asset” value in the plant -- the costs it can no longer expect to recover through future rate increases -- will be $624 million, and SDG&E’s portion will be $151 million. However, SCE will take on an accrued liability of $143 million to reimburse SDG&E for its share of lost ratepayer earnings.

The settlement also reduces SCE’s regulatory asset value by $75 million to account for the funding it got in a spent-fuel settlement with the Department of Energy. But it does allow the utility to keep the $47 million it got in arbitration with Mitsubishi Heavy Industries over the faulty generators that led to its shutdown, as well as whatever it can earn from the spent fuel that remains at the site.

The new deal was widely hailed as a success by the environmental law firms, community activists and newspaper editorial boards that have dogged the CPUC for changes since 2014. The San Diego Union-Tribune, which led much of the initial reporting on the Peevey scandal, called it “a victory for the little guy” -- although the newspaper is also calling for the CPUC to open its internal investigation into how the 2014 deal was allowed to happen in the first place.

This week’s settlement of the troubled San Onofre power plant closure comes amid public outcry over the plan to replace California’s sole remaining nuclear power plant, the 2.3-gigawatt Diablo Canyon station.

Last month, the CPUC approved a closure plan that slashed the amount that plant owner PG&E can raise from ratepayers to pay for workforce retraining and community economic aid to $241 million. That compares to the $448 million that PG&E, the Natural Resources Defense Council, and local unions and community groups called for in a 2016 joint agreement.

As part of this reduction in the cost to be borne by PG&E ratepayers, the CPUC also denied $85 million to help San Luis Obispo County governments and schools recover from the plant’s closure. Diablo Canyon provides 1,500 jobs, 5.8 percent of the county’s tax base, about $1 billion in economic impact on the local economy, according to the San Luis Obispo Tribune. That leaves a huge hole that could either be filled by legislation to allow PG&E to collect the bill from ratepayers, or by the utility bearing the cost itself.

California's abandonment of nuclear power is happening amid a broader crisis for the industry, with old plants closing and new ones being canceled across the country. But it's also playing out as the state seeks to get most, if not all, of its electricity from renewable and carbon-neutral resources in the decades to come. Nuclear power, despite its well-known problems, is a carbon-neutral resource.

San Onofre's unexpected closure left utilities and regulators scrambling for replacements. Clean energy advocates argued for a 100 percent carbon-free mix of solar, wind, demand response, energy efficiency, energy storage and other preferred resources, while utilities argued that they needed to include significant amounts of new natural-gas-fired generation to ensure reliable service in the years to come.

The CPUC eventually approved a plan that opened the country's first contracts for distributed energy resources to meet utility capacity needs, with more than 250 megawatts procured by SCE and SDG&E. The plan also included hundreds of megawatts of natural gas power, despite the protests of community activists and environmental groups.