After spending millions of dollars to quash a renewable energy ballot initiative just two years ago, Arizona’s biggest electricity provider announced Wednesday that it will seek to produce all of its power from carbon-free sources by the middle of the century.

Arizona Public Service laid out an ambitious plan to wean itself entirely off fossil fuels over the next three decades, with the intermediate goal of getting nearly two-thirds of its electricity from nuclear and renewable sources by 2030.

The commitment is an about-face for an electric utility that poured $37.9 million into a campaign to defeat a ballot initiative that would have required it to generate 50 percent of its power from renewable sources by 2030 — a milestone similar to what the company laid out Wednesday.

And it represents a detente between APS and billionaire Tom Steyer, whose 2018 campaign in support of the ballot measure, known as Proposition 127, brought the total amount spent on both sides to at least $62.8 million. Voters ultimately rejected the measure that would shift the state to renewables.

“I am very encouraged by the news from Arizona Public Service this morning and I am also happy that our efforts behind Proposition 127 in 2018 are finally moving Arizona to a more clean energy future,” Steyer, who is now a Democratic candidate for president, said in a statement Wednesday morning. “The plan put forth by APS shows that when public interest advocates keep pushing energy companies, they can get real results.”

The plan outstrips Arizona’s modest renewable requirements, set in 2006, that mandate that utilities rely on renewable energy for 15 percent of supplies by 2025.

In a statement, APS said that after the ballot initiative fight, the utility “took a hard look at our generation mix and future plans” when setting its carbon-free energy goals, which are not legally binding.

The plan is a “huge step forward without the official pressure of the ballot initiative that Steyer put forward,” said Dan Reicher, a Stanford Law School lecturer and former Energy Department official under President Bill Clinton who has consulted with APS.

The decision comes just two months into the tenure of the utility’s new chief executive, Jeff Guldner, who also told state regulators last week that APS will not make political donations to candidates for the commission that regulates the utility. In 2016, the utility and its parent, Pinnacle West Capital, gave at least $4.2 million to a political action committee that promoted members of the Arizona Corporation Commission who were sympathetic to the company’s views.

“As chairman and CEO of both APS and Pinnacle West, I can say under my leadership Pinnacle West and APS and any of our affiliates will neither directly nor indirectly participate in any election of any corporation commissioner through either financial or in-kind support,” Guldner said at a Jan. 14 appearance before the commission.

Investors welcomed the change in tone. “We see value in [Pinnacle West] under new leadership that is already taking tangible steps to improve the regulatory relationship in Arizona,” the electric utilities analysts at Credit Suisse said in a report to investors on Tuesday.

Right now, APS gets roughly a quarter of its electricity from coal, a quarter from natural gas and a quarter from nuclear power.

The utility said that it plans to meet its new targets with a combination of renewable resources, and it added that it is banking on technological advances to eventually eliminate the need for natural gas.

In the meantime, APS said it will rely on existing gas-fired power in the “near term” to make “a sensible transition to clean generating sources.” Over the long term, the utility plans to build large storage facilities, including a previously announced 850-megawatt expansion.

Crucial to APS’s energy mix — both now and going forward — is the Palo Verde Nuclear Generating Station in western Arizona, the nation’s largest nuclear power plant. The station, which APS co-owns and operates, is licensed to run into the 2040s.

In contrast, APS said it will cease generating electricity from burning coal by 2031. The company also has majority stakes in two large coal-fired power plants, according to a report prepared for the Sierra Club by Strategen Consulting. The report said that keeping open the aging coal plants, which are 50 and 51 years old each, was uneconomical.

With its expansive sun-drenched deserts, Arizona ranked second in the nation in total solar energy generation in 2017, according to the U.S. Energy Information Administration. But that is only a fraction of the state’s potential capacity when it comes to drawing power from the sun.

Though she didn’t know the details of the APS plans, Abigail Ross Hopper, president of the Solar Energy Industries Association, said that “the commitment that utilities are making to clean energy is reflective of plunging costs and a much stronger business case for going solar."