A federal appeals court has struck down the Trump administration’s use of emergency powers to require a coal-fired power plant in Michigan to remain open, ruling that the U.S. Department of Energy exceeded its authority.

The 3-0 decision in the U.S. Court of Appeals for the District of Columbia is a rebuke of the administration’s attempt to use a policy tool designed for wartime to stop just about any coal-fired power plant from closing.

Department of Energy officials had said they were responding to a crisis in which the loss of power plants increased the chances of blackouts and brownouts. But state officials, utilities and environmental advocacy groups argued successfully that the actions exceed the narrow and short-term power specified in federal law, and that the state can meet energy needs without the plant.

“My office has been fighting this unlawful political stunt at every turn, and this ruling proves what we have been saying all along: This administration does not get to invent fake emergencies to bypass the rule of law against the best interests of Michigan residents,” said Dana Nessel, Michigan’s attorney general, in a statement.

When asked if the Department of Energy planned to appeal the ruling, an agency spokesperson did not respond directly but said in an email, “Rest assured, the Department of Energy will continue to protect and defend energy security for all Americans.”