HELENA, Mont. (AP) — An appeals court on Friday told a judge to take another look at whether a Montana fish should be protected, saying that U.S. wildlife officials did not consider all environmental factors when it decided against designating the Arctic grayling as a threatened or endangered species.

The three-judge panel of the 9th U.S. Circuit Court of Appeals reversed U.S. District Judge Sam Haddon’s 2016 ruling that the U.S. Fish and Wildlife Service’s decision not to list Montana’s Arctic grayling as threatened or endangered was based on the best available science.

Wildlife officials’ conclusion that the grayling population was increasing was wrong because they did not take into account data that showed the fish’s population in the Big Hole River was declining, the judges said in their decision.

The federal agency also acted arbitrarily and capriciously in dismissing the threats of high stream temperatures, low stream flows and climate change to the grayling population, the judges ruled.

Those factors put grayling in Montana in danger of extinction, said Jenny Harbine, an attorney for the Center for Biological Diversity, which sued force federal protections for the fish.

“The service had blown off the threat to grayling from warmer water temperatures, but the court found they had no legitimate reason to do so,” Harbine said. “Arctic grayling are a cold water fish but as we know increasing summer temperatures, earlier spring runoff and reduced snow pack have impacted the water temperatures in almost all of Montana’s rivers.”

The wildlife advocacy group says in its lawsuit that climate change will only make conditions worse without federal protections in place. Those protections would restrict land and water use in and around the grayling’s habitat.

Fish and wildlife service spokeswoman Jennifer Strickland said her agency is reviewing the ruling and has no comment.

Arctic grayling, a relative of trout known for their sail-like dorsal fin, are also found in Alaska and Canada, but the court case only affects the fish’s Montana population. In Montana, grayling now occupy just 10 percent of the 1,250 miles (2,011 kilometers) of streams in the upper Missouri River basin that they historically inhabited.

In 2010, the fish and wildlife service determined that that Arctic grayling in Montana warranted federal protection, but other species took precedence. Four years later, they said the fish did not warrant listing as threatened or endangered because additional populations had been found and nearly all were stable or improving.

The 2014 decision also factored in a state program that worked with landowners to improve water flows and fish habitat along the Big Hole River, where irrigation had threatened one of the grayling’s last refuges in the state. Gov. Steve Bullock, a Democrat, then touted the program and keeping the grayling off the endangered species list as a success story.

Montana Fish, Wildlife and Parks spokesman Greg Lemon did not immediately return a telephone message seeking comment on the court ruling.

___

AP writer Matthew Brown in Billings, Montana, contributed to this report.