A 63-year-old coal-fired power plant was scheduled to permanently close its doors in Michigan on June 1. So was an oil- and gas-powered plant that was built in the 1960s in Pennsylvania.

But at the last minute, the Trump administration ordered both to stay open. The orders came as it pursues a far-reaching plan to boost fossil fuels, including coal, by declaring a national “energy emergency.”

The grid operators in Michigan and Pennsylvania said they hadn’t asked for the orders and hadn’t planned on using the plants this summer.

The costs to keep the plants open, which could total tens of millions of dollars, are expected to fall on consumers. Experts have said there’s little evidence of a national energy emergency, and 15 states have sued to challenge President Donald Trump’s declaration, which was issued the day he took office.

The emergency orders, which came last month, surprised the companies that operate the plants, and they are now scrambling to delay some workers’ retirements and reverse nearly complete plans to shutter their facilities. In Michigan, the plant operator raced to buy enough coal to power operations.

The episode marks a highly unusual use of the Energy Department’s emergency powers under the Federal Power Act. In the past, the department has typically issued emergency orders at the request of regional grid operators to stabilize the power supply during extreme weather events and blackouts.

Dan Scripps, chair of the Michigan Public Service Commission, said he estimated that the 90-day order to keep the coal plant open would cost ratepayers tens of millions of dollars.

“What was surprising about this order is that nobody was asking for it,” he said. “The grid operator wasn’t asking for this plant to be kept online. The utility that owns and operates the plant wasn’t asking for the plant to be kept online, the state wasn’t asking for the plant to be kept online.”

Dana Nessel, Michigan’s attorney general, a Democrat, said she was “certainly considering” challenging the order affecting the coal plant in her state.

“We think this is par for the course with the Trump administration,” Nessel said. “They’re abusing emergency authorities and really manufacturing an emergency that doesn’t exist, in a way that’s really unprecedented.”

Public Citizen, a consumer advocacy organization, also plans to challenge the orders, according to Tyson Slocum, the group’s energy program director.

The Energy Department did not respond to a request for comment.

Consumers Energy, which runs the J.H. Campbell coal-fired power plant in Michigan, learned about the emergency order on the Friday evening before Memorial Day, just before the announcement was made public, the company’s spokesperson Brian Wheeler said. In a statement, Consumers Energy said it planned to comply.

The plant was just one week away from closing. The order prompted a rush to replenish the giant coal pile that feeds the plant, which had dwindled before the planned closure. Coal is the dirtiest of the fossil fuels in terms of planet-warming pollution.

A week later, near Philadelphia, the oil- and gas-powered Eddystone plant was one day away from closing when it received similar news. In order to keep the affected units available, Constellation Energy, the facility’s parent company, is “currently focused on securing the staff and performing the maintenance necessary,” a spokesperson said.

In its official order, the Energy Department cited projections showing potential summertime electricity generation shortfalls as the basis for the emergency action. Electricity demand is typically higher during the summer when temperatures rise and people use air-conditioning. Overall electricity demand is projected to increase because of data center construction and the adoption of electric vehicles.

All told, 108 plants with a combined capacity of 31.5 gigawatts are set to be retired by the end of Trump’s term. That list includes 25 coal plants with a combined capacity of 18.2 gigawatts. One gigawatt is roughly enough to power the city of San Francisco.

In an April executive order, Trump directed the Energy Department to develop a process for using emergency powers to prevent coal plants from shutting down. It’s not clear whether such a process informed the Michigan order.

Trump attempted something similar during his first term, but the idea faced fierce opposition from grid operators, power companies and consumers, and the White House eventually backed down.