Late last week, a federal court knocked down plans to expand coal mining in the Western US, adding to a growing body of rulings against the Trump administration’s efforts to push climate change off the agenda.

The surprising decision from the United States Court of Appeals for the 10th Circuit, which has jurisdiction in Colorado, Kansas, Utah, New Mexico, Oklahoma, and Wyoming, told the Bureau of Land Management to redo its math on greenhouse gas emissions from coal leases and sent the approval of these leases back to a lower court.

Under the National Environmental Policy Act, federal agencies have to consider how a given proposal both affects climate change and is affected by climate change.

The 10th Circuit is the highest court to rule on climate change accounting so far, and its opinion undercuts President Donald Trump’s efforts to resuscitate the dying US coal industry.

“It’s reaffirming what a lot of people already knew: Government has to take a hard look at what their environmental impacts are,” said Sam Kalen, a law professor at the University of Wyoming. “Cases like this are sending signal that regardless of what the administration wants to do, the law says you have to take a look at these issues.”

In March, President Trump lifted President Barack Obama’s moratorium on coal leasing and stopped a comprehensive review of federal coal policy, with the goal of spurring more coal mining.

However, the courts are once again standing in the way of Trump’s agenda.

A massive coal mining expansion is at stake

At issue are four proposed leases in the Powder River Basin, a 14-million-acre region spanning Wyoming and Montana containing 40 percent of US coal deposits and responsible for 13 percent of the country’s greenhouse gas emissions, according to the Sierra Club, one of the groups joining the lawsuit against BLM.

The leases would expand the world’s two largest coal mines, which already produce 25 percent of the coal burned in the US. The new mining territory contains 2 billion tons of coal, that when combusted, would produce 3.3 billion metric tons of carbon dioxide, equivalent to the emissions 1,000 coal-burning power plants, according to WildEarth Guardians, another plaintiff in the case against BLM.

The new leases would maintain production at these mines at 230 million tons per year.

BLM’s case for ignoring climate change was weak

The federal government owns much of the Powder River Basin and it has to disclose the impacts of leasing this land to private companies for mining under the National Environmental Protection Act.

One of the impacts BLM has to measure is greenhouse gas emissions.

In 2009, several coal companies applied for new leases, and BLM handwaved away concerns about climate change in its Environmental Impact Statements for these applications.

The bureau relied on the idea of “perfect substitution,” arguing that if this coal wasn’t mined in the Powder River Basin, it would be mined elsewhere, so the impact on total greenhouse gas emissions in the United States is a wash.

The 10th didn’t buy it.

“This long logical leap presumes that either the reduced supply will have no impact on price, or that any increase in price will not make other forms of energy more attractive and decrease coal’s share of the energy mix, even slightly,” Judge Mary Beck Briscoe wrote in her ruling.

That is to say, if millions of tons of cheap Powder River Basin coal are no longer on the US market, it’s likely that power producers will switch to cleaner alternatives rather than dig up more expensive coal in other parts of the country.

That means keeping the coal in the ground would benefit the fight against climate change and burning it would increase greenhouse gas emissions.

Advocates didn’t see this ruling from this court coming

Covering a large swath of Western coal country, the 10th Circuit has a reputation for being conservative. (Trump’s Supreme Court pick Neil Gorsuch was plucked from this court.)

“Our batting average at the 10th Circuit is pretty close to zero,” said Jeremy Nichols, climate and energy program director at WildEarth Guardians.

However, the ruling fits a pattern of federal courts pushing back against agencies that are trying to gloss over their statutory climate change obligations.

“I think it is a good surprise,” said Jayni Hein, policy director at the Institute for Policy Integrity at the New York University School of Law.

Hein was a co-author of an amicus curiae brief filed on behalf of the plaintiffs in this case.

“We are more used to seeing decisions like this from the Ninth Circuit, which has been a leader on requiring accounting for climate change. It’s a sign that courts are recognizing the importance of this,” Hein said.

What happens next

The Department of the Interior and BLM declined to comment. A spokesperson for the Justice Department said, “DOJ is reviewing the opinion.”

As for BLM’s next move, the court told the agency to redo its assessment of the climate change impacts of the four leases. But it didn’t reject the leases, and coal producers are optimistic they will remain in force.

“The court has appropriately determined that mining operations can and should continue, and we remain confident in the BLM’s ability to address the ‘fairly narrow’ issues identified by the court,” Peabody Energy, the world’s largest private coal firm and parent company of one of the defendants, said in a statement.

“That is a less satisfying aspect of this ruling,” said Hein. “Certainly when the court has found a NEPA violation to this degree it would seem just to vacate these leases.”

The plaintiffs don’t anticipate the case being appealed to the Supreme Court since there doesn’t seem to be much of a difference of opinion among the different circuit courts.

Instead the future of the Powder River Basin leases falls to district courts.

“We automatically have another fight on our hands,” said Nichols. “We’re going to go in and ask the court to vacate approvals.”

The Colorado District Court has previously ruled against the mining industry on climate change grounds.

But the coal industry as a whole is suffering from intense competition from other energy sources, and fighting for new mining rights doesn’t solve any of its root problems, like its cost relative to natural gas. So as these leases work their way through the courts, the market is likely to continue to be the much bigger threat to the future of coal.

Correction: Due to an editing error, a previous version of this story stated that coal producers were optimistic their leases might still be approved. In fact, coal companies are optimistic the leases will remain in force.