A federal judge in Washington, D.C., has dealt a significant blow to environmental groups fighting to protect the Boundary Waters Canoe Area Wilderness from copper-nickel mining in Minnesota.

U.S. District Judge Trevor McFadden ruled that the Trump administration acted within its authority when it reissued two mineral leases for the proposed Twin Metals copper-nickel mine in 2018.

The Obama administration had previously denied the company’s request to renew its two leases to mine on 5,000 acres of public land in Superior National Forest after the U.S. Forest Service concluded that copper mining so close to the Boundary Waters was too risky, and it could cause “serious and irreparable harm” to an “irreplaceable wilderness area.”

In his decision released Tuesday, McFadden, a Trump appointee, found that the U.S. Department of the Interior acted within its “inherent reconsideration authority,” and did nothing wrong in resurrecting the Twin Metals’ leases.

“Here, Interior timely corrected an error that would have deprived Twin Metals of its right to valuable leases,” McFadden wrote.

The decision is a key moment in the legal and political battle over opening up Minnesota to companies wanting to mine precious metals such as copper. This type of hard-rock mining poses far greater environmental risks than taconite or iron ore — particularly in the watery ecosystems in the state’s northeast — because of the sulfide and heavy metals that can leach out of the rock it must crush to get at the ore.

Drawing sides Fierce Iron Range support: The project has passionate support in Iron Range communities seeking new year-round, high wage industrial jobs. Activists continue fight: Environmental groups vow to appeal the case. Majority polled oppose: A Star Tribune poll found 60% of Minnesotans oppose building new mines near the Boundary Waters.

For Twin Metals Minnesota, a subsidiary of Chilean copper mining giant Antofagasta, McFadden’s decision was a crucial step.

“This decision once again validates our position that these mineral leases that have been held by Twin Metals Minnesota and its predecessor companies for more than 50 years should have been renewed in 2016,” the company said in a statement. “This is encouraging news for the communities of northeast Minnesota who look forward to the hundreds of jobs and economic development our mine will bring to the region.”

The company plans to extract 20,000 tons of ore per day from the huge underground copper-nickel mine it wants to build just outside the Boundary Waters near Birch Lake. It submitted its official plan to state and federal regulators in December. The Twin Metals project is one of two fiercely debated copper-nickel mines proposed for northeast Minnesota.

The project has passionate support in Iron Range communities desperate for the type of year-round, high wage industrial jobs the mines would provide, even though a recent Star Tribune/MPR Minnesota Poll found that 60% of Minnesotans oppose building new mines near the Boundary Waters.

Environmental groups vowed to appeal.

“The plain, straightforward language of the leases makes it clear that Twin Metals is not entitled to an automatic renewal of the mineral leases,” said Chris Knopf, executive director of Friends of the Boundary Waters Wilderness. “The court is giving Twin Metals a forever lease. Based on the original contract, this is an overreach that defies common sense.”

Tom Landwehr, executive director of the Campaign to Save the Boundary Waters, also expressed dismay.

“Today is a slap in the face to science, the rule of law, the Boundary Waters Wilderness, and the American people,” Landwehr said in a statement. “This decision failed to recognize the clear, plain language of the leases and twisted itself into knots to justify the predetermined policy decision of the Trump Administration to sell out America’s most popular Wilderness to a Chilean billionaire who also happens to be the landlord of Ivanka Trump.”

Ivanka Trump and her husband, White House adviser Jared Kushner, rent an expensive Washington, D.C., home that was bought by a U.S. real estate company owned by Andrónico Luksic, chairman of the family company that owns Antofagasta.

The two advocacy groups were part of the coalition that sued the Department of the Interior after it reissued the Twin Metals leases. The coalition included nine Minnesota businesses such as Voyageur Outward Bound School and River Point Resort and Outfitting Co.