A US judge has ordered federal protections to be restored for grizzly bears in the Northern Rocky Mountains.

Wyoming and Idaho had been on the cusp of allowing hunters to kill up to 23 bears this autumn.

US District Judge Dana Christensen had twice delayed the hunts, and the latest order blocking them was due to expire later this week.

The hunts would have been the first in US outside Alaska since 1991.

Judge Christensen wrote in his ruling that the case was “not about the ethics of hunting”. Rather, he said, it was about whether federal officials adequately considered threats to the species’ long-term recovery when they lifted protections for more than 700 bears living around Yellowstone National Park.

In the judge’s view, the answer was no.

He noted that an estimated 50,000 bears once roamed the mainland US and said it would be “simplistic at best and disingenuous at worst” not to consider the status of grizzlies outside the Yellowstone region, one of the few areas where they have bounced back.

State and federal officials reacted with disappointment. Wyoming Gov Matt Mead said the ruling provided further evidence of flaws in the Endangered Species Act and the need for Congress to make changes.

“Grizzly bear recovery should be viewed as a conservation success story,” Gov Mead said in a statement.

A bid to remove protections for the region’s grey wolves ran into similar legal problems last decade.

In that case, Congress intervened in 2011 to strip safeguards from the animals through legislation, opening the way to public wolf hunts.

Pressure to lift protections on bears and allow hunting has increased in recent years as the number of conflicts between bears and people increased.

Most of those conflicts involve attacks on livestock but occasionally bears attack people, such as a Wyoming hunting guide killed earlier this month by a pair of grizzly bears.

The ruling marks a victory for wildlife advocates and Native American tribes that sued when the Interior Department last year revoked federal protections.

They argued that the animals face continued threats from climate change and loss of habitat.