WASHINGTON (AP) — The Trump administration on Wednesday completed one of its biggest rollbacks of environmental rules, replacing a landmark Obama-era effort that sought to wean the nation’s electrical grid off coal-fired power plants and their climate-damaging pollution.

Environmental Protection Agency chief Andrew Wheeler, a former coal industry lobbyist, signed a replacement rule that gives states leeway in deciding whether to require efficiency upgrades at existing coal plants.

Wheeler said coal-fired power plants remained essential to the power grid, something that opponents deny. “Americans want reliable energy that they can afford,” he said at a news conference. There’s no denying “the fact that fossil fuels will continue to be an important part of the mix,” he said.

Rep. David McKinley, a West Virginia Republican, was one of several coal country lawmakers on hand for the signing. He argued that power from the sun and wind was not yet reliable enough to depend on. “We’re not ready for renewable energy … so we need coal.”

President Donald Trump campaigned partly on a pledge to bring back the coal industry, which has been hit hard by competition from cheaper natural gas and renewable energy.

The rule will go into effect shortly after publication in the Federal Register. Environmental groups pledge court challenges.

“The Trump administration’s outrageous Dirty Power Scam is a stunning giveaway to big polluters, giving dirty special interests the greenlight to choke our skies, poison our waters and worsen the climate crisis,” House Speaker Nancy Pelosi, D-Calif., said in a statement.

Joseph Goffman, an EPA official under President Barack Obama, said he feared that the Trump administration was trying to set a legal precedent that the Clean Air Act gives the federal government “next to no authority to do anything” about climate-changing emissions from the country’s power grid.

WATCH: How 2020 Democrats plan to address climate change

The Obama rule, adopted in 2015, sought to reshape the country’s power system by encouraging utilities to rely less on dirtier-burning coal-fired power plants and more on electricity from natural gas, solar, wind and other lower or no-carbon sources.

Burning of fossil fuels for electricity, transportation and heat is the main human source of heat-trapping carbon emissions.

Supporters of the revised rule say the Obama-era plan overstepped the EPA’s authority.

“This action is recalibrating EPA so it aligns with being the agency to protect public health and the environment in a way that respects the limits of the law,” said Mandy Gunasekara, a former senior official at the EPA who helped write the replacement rule. She now runs a nonprofit, Energy45, that supports President Donald Trump’s energy initiatives.

“The Clean Power Plan was designed largely to put coal out of business,” Gunasekara said. Trump’s overhaul is meant to let states “figure out what is best for their mission in terms of meeting modern environmental standards” and providing affordable energy, she said.

Democrats and environmentalists say the Trump administration has ignored scientific warnings about climate change as it sought to protect the sagging U.S. coal industry.

“The growing climate crisis is the existential threat of our time and President Trump’s shameful response was to put lobbyists and polluters in charge of protecting your health and safety,” Pelosi said.

With coal miners at his side , Trump signed an order in March 2017 directing the EPA to scrap the Obama rule. It was one of the first acts of his presidency.

His pledge to roll back regulation for the coal industry helped cement support from owners and workers in the coal industry, and others. Despite his promise, market forces have frustrated Trump’s efforts . Competition from cheaper natural gas and renewable fuel has continued a yearslong trend driving U.S. coal plant closings to near-record levels last year, according to the U.S. Energy Information Administration.

By encouraging utilities to consider spending money to upgrade aging coal plants, environmental groups argue, the Trump rule could prompt the companies to run existing coal plants harder and longer rather than retiring them.

“It’s a rule to increase emissions because it’s a rule to extend the life of coal plants,” said Conrad Schneider, advocacy director of the Clean Air Task Force. “You invest in updating an old coal plant, it makes it more economic” to run it more to pay off that investment.

An Associated Press analysis Tuesday of federal air data showed U.S. progress on cleaning the air may be stagnating after decades of improvement. There were 15% more days with unhealthy air in America both last year and the year before than there were on average from 2013 through 2016, the four years when America had its fewest number of those days since at least 1980.

Trump has repeatedly claimed just the opposite, saying earlier this month in Ireland: “We have the cleanest air in the world, in the United States, and it’s gotten better since I’m president.”

Along with an initiative requiring tougher mileage standards for cars and light trucks, the Clean Power Plan was one of Obama’s two legacy efforts to slow climate change. The Trump administration also is proposing to roll back the Obama-era mileage standards, with a final rule expected shortly. Environmental groups promise court challenges to both rollbacks.

Trump has rejected scientific warnings on climate change, including a report this year from scientists at more than a dozen federal agencies noting that global warming from fossil fuels “presents growing challenges to human health and quality of life.”

The EPA’s own regulatory analysis last year estimated that Trump’s replacement ACE rule would kill an extra 300 to 1,500 people each year by 2030, owing to additional air pollution from the power grid.

WATCH: What revoking the Clean Power Plan means, from both sides