A federal judge on Thursday struck down a Trump administration move to take gray wolves in most states off the Endangered Species Act list — a presidential action that led to a controversial wolf hunting season in Wisconsin last year.

U.S. District Judge Jeffery White, of California, reversed a 2020 U.S. Fish and Wildlife Service rule removing wolves from the list in 45 states. The ruling does not affect the Northern Rockies.

That Trump decision relied too much on thriving gray wolf populations near the Great Lakes and in the Rocky Mountains, without studying populations in the rest of the contiguous United States, wrote White, who was named to the federal bench by President George W. Bush.

“The Service did not adequately consider threats to wolves outside of these core populations,” he wrote. “Instead, the Service avoids analyzing these wolves by concluding, with little explanation or analysis, that wolves outside of the core populations are not necessary to the recovery of the species.”

The FWS finalized the delisting rule in November 2020, mere months before Trump was to leave office.

Conservation groups Earthjustice, Center for Biological Diversity, Defenders of Wildlife, the Humane Society of the United States, Sierra Club, National Parks Conservation Association and Oregon Wild challenged the ruling in court.

The delisting created the opportunity for Wisconsin to hold a three-day wolf hunting season in February 2021. The effort was criticized after 216 wolves — nearly double the 119 quota allotted to non-Native American hunters — were killed.

“I’m relieved that the court set things right but saddened that hundreds of wolves suffered and died under this illegal delisting rule. It will take years to undo the damage done to wolf populations,” Collette Adkins, carnivore conservation director for Center for Biological Diversity, said in a statement.

The 2020 delisting did not apply to wolf populations in the Northern Rockies, which includes Idaho, Montana and roughly the eastern third of Oregon.

Wolf populations in the region were federally delisted in 2011 and remain under state management. As the 2020 rule did not affect that status, neither does Thursday’s ruling.

President Joe Biden’s administration had not taken any steps to permanently relist the species. A spokesperson for the Fish and Wildlife Service did not return a message asking if the administration would appeal the decision.

Several ranching groups intervened in the case and could also appeal.