(AP) – The demise of California’s San Onofre nuclear power plant began with an attempt to fix it.

A $670 million equipment swap in 2009 and 2010 went haywire, leaving Southern California Edison on Friday with two idle reactors, more than $500 million in bills and a federal decision on a possible restart nowhere in sight.

The company decided to close it, permanently. The announcement triggered a celebration among environmentalists and other critics of the nuclear power industry who argued the plant was too damaged to operate safely.

“There’s a huge sense of relief for us,” said Laguna Beach Councilwoman Toni Iseman, whose community is about 20 miles up the coast from San Onofre’s twin domes. “We were just sitting with a time bomb just to the south of us.”

Erich Pica, president of Friends of the Earth, said San Onofre’s closing represents an opportunity for California to use more wind, solar and other clean energy. The group waged a long fight to block the restart.

The U.S. nuclear industry, Pica said, “is on its final trajectory downward.”

The San Onofre reactors — situated along the Pacific Coast in the densely populated corridor of millions of people between San Diego and Los Angeles — are the largest to shut down permanently in the U.S. in the past 50 years, federal officials said.

It was a jolt to the nation’s nuclear power industry, which had been encouraged in recent years by development of new plants in the Southeast. Steve Kerekes, a spokesman for the Nuclear Energy Institute, an industry group, described San Onofre’s problems as unlike any other reactor and said Edison’s decision highlights a flawed, plodding regulatory system.

“This is a blow to California’s energy diversity but is not an indicator of the industry’s larger ability to reliably supply low-carbon electricity,” he said.

Edison’s decision brought to a sudden end a dispute that began in January 2012, when a small radiation leak led to a shutdown and the discovery of unusual damage to hundreds of tubes that carry radioactive water in the plant’s virtually new steam generators.

San Onofre never produced electricity again.

The company was facing a tangle of investigations and regulatory hurdles, along with political pressure from Sen. Barbara Boxer, D-Calif., among others. In a conference call with reporters, Ted Craver, chairman of the utility’s corporate parent, Edison International, acknowledged the company suffered a major blow last month when the NRC’s Atomic Safety and Licensing Board split with the NRC staff and rejected Edison’s arguments to restart the plant.

That left Edison facing months of possible appeals and motions, with no certainty a restart would occur.

“We’ve made our decision based on the facts in front of us,” he said.

San Onofre — whose first reactor operated from 1968 to 1992, with two others added in the 1980s — was capable of powering 1.4 million homes. California officials have said they can make it through the hot season without the plant as long as the summer is uneventful, but warned that wildfires or another disruption in supply could cause power shortages.

It wasn’t clear how the electricity from the plant would be replaced permanently. The California Public Utilities Commission said it will work with governments to ensure Southern California has enough electricity, which could require increased energy efficiency and conservation, as well as upgrades to equipment.

Mitsubishi Nuclear Energy Systems, which built San Onofre’s steam generators, said it is disappointed with the decision and remains confident the plant can be operated safely.

It will take months, and possibly years, to complete the closing of the reactors, which will involve removing all fuel from the reactor cores.

And still unresolved: who pays for all the trouble, customers or shareholders.

Boxer, who heads the Environment and Public Works Committee, said in a statement the plant “had a defective redesign and could no longer operate as intended. Modifications to the San Onofre nuclear plant were unsafe and posed a danger to the 8 million people living within 50 miles of the plant.”

The problems center on four new, much-heavier steam generators that were installed during in 2009 and 2010. Just a few years later, tests found some generator tubes so badly eroded that they could fail and possibly release radiation, a startling finding for nearly new equipment.

Federal investigators last year concluded that a botched computer analysis resulted in design flaws that were largely to blame for the heavy tube wear. Edwin Lyman, a nuclear expert at the Union of Concerned Scientists, a watchdog group, said the mistake raises broad questions for an industry that regularly relies on computer tools.

“That has larger importance, especially for new reactors,” Lyman said

Each generator has 9,727 alloy tubes, which function somewhat like a radiator. The tubes circulate hot, radioactive water, which then heats a bath of non-radioactive water surrounding them. That makes steam, which drives the turbines to generate electricity.

In other nuclear-industry shutdowns over the years, decaying generator tubes helped push San Onofre’s original reactor into retirement in 1992, even though it was designed to run until 2004. In 1993, the Trojan plant near Portland, Ore., was shuttered years earlier than planned because of microscopic cracks in steam tubes. The Shoreham plant on New York’s Long Island was completed in 1984 for $6 billion but never opened because of community opposition.

In February, Duke Energy Corp. decided to close the Crystal River nuclear plant in Florida after workers cracked a concrete containment building during a 2009 upgrade, and an attempt to fix it in 2011 caused more cracks. Last fall, Dominion Resources Inc. said it would close the Kewaunee Power Station in Wisconsin after it was unable to find a buyer.

___

By MICHAEL R. BLOOD

Associated Press writer Matthew Daly in Washington, Ray Henry in Atlanta and Gillian Flaccus and Amy Taxin in San Clemente, Calif., contributed to this report.