The Diablo Canyon nuclear power plant in Avila Beach, Calif., will be shut down by 2025. Among other issues, it was the subject of a long-running debate over its ability to withstand earthquakes; one fault runs 650 yards from the reactors. (Michael A. Mariant/AP)

The California utility that owns a pair of nuclear power reactors at Diablo Canyon said in an agreement with environmental groups that it will close the plants when their licenses expire in the middle of the next decade instead of applying for license renewals.

The closing of the two reactors will leave California without any nuclear power plants after April 2025. The utility, Pacific Gas and Electric, said it would replace the nuclear power generated there with renewable-energy projects and energy-efficiency initiatives.

The decision ends a ­long-running battle over the fate of the Diablo Canyon reactors, located near major geological fault lines close to the California coast about halfway between Los Angeles and San Francisco. The twin 1,100-megawatt reactors produce about 9 percent of the state’s electricity.

Several leading climate scientists have supported extending the licenses because the power is generated without greenhouse gas emissions, but environmental groups have said the location of the reactors puts hundreds of thousands of Californians in danger in case of an accident or an earthquake.

“This is an historic agreement,” Erich Pica, president of Friends of the Earth, said in a statement. “It sets a date for the certain end of nuclear power in California and assures replacement with clean, safe, cost-competitive, renewable energy, energy efficiency and energy storage. It lays out an effective roadmap for a nuclear phase-out in the world’s sixth-largest economy, while assuring a green energy replacement plan to make California a global leader in fighting climate change.”

The Diablo Canyon reactors are the latest nuclear power plants to be closed as a combination of cheap natural gas and new ­renewable-energy projects makes competition difficult. Four reactors were shut down in 2013 — including the San Onofre nuclear power station near Los Angeles — and one was taken offline in 2014. Meanwhile, a plant opened this year in Tennessee, and four more are under construction elsewhere. The current total of operating reactors in the United States is 100.

However, many reactors, most about four decades old, are coming to the end of their licenses, and companies are weighing returns on renewable-energy projects against the cost of making improvements to nuclear plants to persuade the Nuclear Regulatory Commission to grant long-term extensions.

That worries supporters of nuclear power. “While solar and wind have grown significantly, they have not grown enough to make up for lost nuclear,” said Michael Shellenberger, founder of the pro-nuclear group Environmental Progress.

California’s renewable portfolio standard requires that by 2030, utilities get 50 percent of their electricity from renewable sources — without counting nuclear power. PG&E said it would hit a 55 percent renewable target by 2031.

“California’s energy landscape is changing dramatically with energy efficiency, renewables and storage being central to the state’s energy policy,” PG&E chief executive Tony Earley said in a statement. “As we make this transition, Diablo Canyon’s full output will no longer be required.”

Geisha Williams, PG&E’s president for electricity, said in a conference call that the company concluded that ratepayers would not pay more for new renewable sources of energy than they would have paid to keep Diablo Canyon open. But she said that calculation took as a given the state’s renewable portfolio standard, which mandates sharp increases in ­renewable-energy use and might have forced the reactors to run at as little as half their capacity.

PG&E also faced other regulatory hurdles to renew the nuclear permits. The California State Lands Commission will meet June 28, and Lt. Gov. Gavin Newsom (D) and two other members could seek to deny a critical permit for Diablo Canyon.

Other parties to the agreement include Friends of the Earth, the International Brotherhood of Electrical Workers Local 1245, the Coalition of California Utility Employees, the Natural Resources Defense Council, Environment California and the Alliance for Nuclear Responsibility.

PG&E said it will spend $350 million to help keep a skilled workforce in place while the plant is functioning. The company will also pay the local county, San Luis Obispo, $50 million.

The closing of Diablo Canyon has historical significance in the environmental movement. In 1969, David Brower quit his position as executive director of the Sierra Club after 17 years following a dispute with other club leaders over whether to oppose the construction of the reactors. Brower, who died in 2000, then founded two new groups, Friends of the Earth and the John Muir Institute for Environmental Studies. He later reconciled with the Sierra Club.

Elsewhere in the utility industry, many companies are sticking with nuclear power. Duke Energy chief executive Lynn Good said, “We love the nuclear plants that we operate.” Good said the utility’s 11 reactors help keep its carbon emissions down and its electricity rates 20 to 30 percent below the national average. She said Duke Energy is seeking extensions of its licenses so it can “continue operating these plants as far as we can.”

But the NRDC’s energy coordinator, Ralph Cavanagh, said renewable resources and improved storage devices are more flexible than nuclear power, which is designed to deliver steady base-load power and not to be ramped up or down. He said phasing out Diablo Canyon will give PG&E time to develop more renewable-energy sources rather than forcing the utility to turn to more readily available natural gas as a substitute.