A judge is forcing the Trump administration to sit down with environmental groups to figure out how to balance climate change concerns with continued mining in the West that supplies 40 percent of the nation's coal.

U.S. District Court Judge Brian Morris in Montana issued a ruling Monday that the Interior Department must evaluate climate change before approving coal mining leases. The analysis could limit the amount of coal allowed to be mined.

Environmentalists applauded the ruling as a victory. They sued the Bureau of Land Management for not adequately evaluating alternatives to coal mining in its environmental review of mining plans that it is required to do under the National Environmental Policy Act, thereby failing to take into consideration the effects of climate change.

However, the judge did not grant a motion to cease all mining activities in the Powder River Basin region of Wyoming and Montana.

Morris ordered the Interior Department, industry stakeholders, and environmentalists sit down and figure out how to resolve their concerns in 60 days.

"The parties shall meet and confer in good faith to attempt to reach an agreement as to remedies," the order read. "If the parties cannot agree, the parties shall submit additional briefing on remedies no later than 60 days from today’s date."

The court order affects the Powder River Basin area that comprises Wyoming and Montana, which is a major coal supplier to U.S. coal power plants.

The Bureau of Land Management had argued against environmental claims, saying it would measure the climate change effects when the companies file to renew or expand their current leases.

But Morris disagreed, saying the "law does not allow for such blanket deferral."

Nevertheless, he did agree that the Interior Department did assess methane emissions adequately in granting coal leases under its current resource management plan. The environmentalists argued it did not take into consideration the methane emissions.

Still, environmental groups are claiming victory over coal, based on the ruling. The judge's order favors reducing fossil fuels to combat global warming, they argue.

"This ruling is the latest example of courts forcing the federal government to be honest with the American public about how coal, oil and gas leasing is contributing to the growing impacts of climate change," said Mike Scott with the Sierra Club, one of the six plaintiffs in the lawsuit.

In a blog post Monday, Sharon Buccino, the Natural Resources Defense Council's land and wildlife director, titled her analysis of the ruling, "Judge Tells Trump to Rethink Coal."

She wrote the judge ruled the Bureau of Land Management violated the National Environmental Policy Act "by failing to consider any alternative in its land use plans that would decrease the amount of coal available for leasing."

The agency also failed to consider the impacts of burning coal, oil, and natural gas, which it is required to do, she added.

The court did not agree with the groups' claims in their entirety, but in part.

"NEPA requires BLM to conduct new coal screening and consider climate change impacts to make a reasoned decision on the amount of recoverable coal made available," according to the judge's ruling.

However, the environmental law "does not" require the agency "to 'address every conceivable alternative'” to fossil fuel production in its analysis.