The Obama administration imposed a moratorium on most federal coal sales in 2016. The move followed concerns that low royalty rates paid by mining companies were shortchanging taxpayers and that burning the fuel was making climate change worse.

President Donald Trump lifted the moratorium in March 2017 as part of his efforts to revitalize the slumping coal industry.

“The moratorium provided protections on public lands for more than 14 months,” Morris said in Friday’s 34-page order. He added that lifting the moratorium was a “major federal action” sufficient to trigger requirements for a detailed analysis of its environmental impacts.

Morris ordered government attorneys to enter negotiations with states, tribal officials and environmental groups in order to determine the next steps in the case.

“The court held clearly that the Trump administration needs to rationally consider the consequences of its decision. Those include dire impacts to clean water, public health and our climate,” said Earthjustice attorney Jenny Harbine, who represents environmental groups and the Northern Cheyenne Tribe, which had sued to stop the lease sales.

The attorneys general of California, New Mexico, New York and Washington, all Democrats, also had sued over the resumption of the federal coal lease program. They said it should not have been revived without studying what’s best for the environment and for taxpayers.

Interior Department spokeswoman Faith Vander Voort said the agency is reviewing the ruling.

In February, Interior officials had announced a sale of coal leases on public lands in Utah by issuing a statement headlined “The War on Coal is Over.” They said the sale would not have been possible if the administration had not overturned the moratorium.

The department’s Bureau of Land Management administers about 300 coal leases in 10 states. Most of that coal — 85 percent — comes from the Powder River Basin in Wyoming and Montana. Other states with significant federal coal reserves include Colorado and New Mexico.

Production and combustion of coal from federal lands accounted for about 11 percent of U.S. greenhouse gas emissions in 2014.