A Canadian gold-mining company allowed by the Trump administration to write its own assessment of the environmental impact of its proposed project on federal lands has lost a round in court against the Nez Perce tribe in Idaho.

U.S. District Court Judge Barry Lynn Winmill denied a motion from Midas Gold to dismiss the tribe’s lawsuit.

The tribe sued the British Columbia company in August, saying it violated the Clean Water Act by failing to stop the discharge of pollutants, including arsenic, cyanide and mercury, from gold mines into tributaries of the Salmon River, threatening fish populations important to the Nez Perce.

“As the tribe has repeatedly stated, Midas Gold’s failure to address unlawful pollution discharges” in Payette National Forest in central Idaho is “harming the tribe and the people of Idaho,” Tribal Chairman Shannon Wheeler said in a statement.

The mining site is within the tribe’s aboriginal territory, where Nez Perce fishing, hunting and pasturing rights are ensured by an1855 treaty with the U.S. government.

The area had previously been mined by various companies over decades. Midas Gold, which now owns or controls much of the site, is seeking permits to reopen mining and expand operations as part of its Stibnite Mining Project, and is carrying out exploratory drilling.

Pollution occurring “regularly or continuously for at least the last five years,” is “ongoing now, and will continue into the future, unless the Court grants relief as requested,” the lawsuit states.

Despite the claims, the U.S. Forest Service last year stepped aside to allow the company to take control of an assessment analyzing the impact of its own mining proposal, according to documents obtained by the nonprofit conservation organization Earthworks.

Such an assessment is supposed to be written by the Forest Service or an independent contractor without a vested interest in conclusions, according to the group.

“It’s particularly inappropriate for a mining company to be analyzing their own project,” said Connie Gestring of Earthworks.

Documents show that initially strong resistance by the Forest Service to the project and involvement by Midas Gold in the assessment process began to crumble amid lobbying pressure within a receptive Trump administration. Midas Gold was eventually designated to take the lead in in creating the environmental impact report.

“To be clear, Midas will have the lead on fish, wildlife and plants ESA [Endangered Species Act] consultation,” Keith Lannom, then supervisor of the Payette National Forest, declared to his staff late last year in an email obtained by Earthworks.

Lobbying by companies is expected in such cases, John Freemuth, a land policy expert at Boise State University, told The Associated Press. But he has never before heard of a company being allowed to write a biological assessment analyzing its own operation.

Mckinsey Lyon, vice president of external affairs for Midas Gold, insisted to AP that the company’s role is normal.

The report hasn’t been completed. A decision on the Midas Gold operation will be made in 2020.

The Environmental Protection Agency has spent some $4 million restoring habitat in the Payette National Forest after open-pit mines were abandoned by other companies, according to AP.