A federal appeals court has thrown out a bid by environmental groups to challenge expanded coal mining on the Navajo Reservation that powers the Four Corners Power Plant.

The U.S. 9th Circuit Court of Appeals ruled Monday that any legal action contesting the decisions of the federal government to grant the necessary permits must also include the Navajo Transitional Energy Co. That entity purchased the mine from a private firm, which had been operating on the reservation.

Judge Michelle Friedland, writing for the unanimous three-judge panel, pointed out that the company is wholly owned by the Navajo Nation. And she said the tribe has sovereign immunity, meaning it cannot be sued.

Friedland said that, given the tribe’s reliance on the mine and the money it generates, it would be unfair to allow the case to proceed without the tribal company. Shiloh Hernandez, an attorney for the Western Environmental Law Center, which filed the suit on behalf of a coalition of environmental interests, said he had no immediate comment.

A 33,000-acre strip mine has been operating since the early 1990s. Its only customer is the Four Corners plant, located on the reservation, which gets all of its coal from the mine.

In 2011, Arizona Public Service, which operates the plant for several utilities and the Navajo Nation, amended the lease to extend its term through 2041.

BHP Billiton, the private company that at the time owned the mine, then sought a renewal of the existing surface mining permit and a new permit to allow operations to move to an additional area.

The federal Office of Surface Mining Reclamation and Enforcement took the lead for several federal agencies whose approval was required. According to court records, that agency, after consulting with the Fish and Wildlife Service, concluded that the proposal would not jeopardize continued existence of any threatened or endangered species. The conclusions were approved by the Department of Interior in 2015.

The environmental groups, led by Dine Citizens Against Ruining Our Environment, filed suit against the federal agencies, alleging that the Fish and Wildlife opinion violated the requirements of the Endangered Species Act and that the federal agencies violated the law by relying on a faulty opinion.

They also said the federal agencies failed to consider reasonable alternatives and failed to take a “hard look” at various impacts of the mining complex.

But the suit came to a halt when the Navajo-owned company that bought out BHP’s interest demanded to be included in the lawsuit and then sought its dismissal based on tribal sovereign immunity.

Friedland said there is no question but that the Navajo company must be part of the lawsuit.

“At stake is an estimated $40 million to $60 million per year in revenue for the Navajo nation, as well as its ability to use its natural resources how it chooses,” the judge said.

APS owns 63% of the power plant, with smaller shares owned by several utilities including Tucson Electric Power and Salt River Project. An APS spokeswoman said the plant provides about 12% of the utility’s power.