A judge has overturned a controversial decision by the Trump administration to remove federal protections from Yellowstone’s iconic grizzly bears.

A US federal judge reinstated endangered species status for grizzly bears near Yellowstone National Park on Monday, overturning the Trump administration’s unpopular decision to delist them last year.

The delisting was found illegal by US District Court Judge Dana Christensen, who said the August 2017 decision was based on poorly applied science. The US Fish and Wildlife Service, which enforces the Endangered Species Act, “illegally negotiated away its obligation to apply the best available science in order to reach an accommodation with the states of Wyoming, Idaho, and Montana,” Christensen wrote.

Last year, the Northern Cheyenne tribe and conservation groups filed a lawsuit challenging the agency’s decision, and alleged that grizzly bear protections could not be removed without affecting populations across North America.

The decision also put an end to proposed grizzly bear hunts in Wyoming and Idaho this fall. Today, there are more than 700 grizzlies living in the Greater Yellowstone area.

“We have a responsibility to speak for the bears, who cannot speak for themselves,” Lawrence Killsback, president of Northern Cheyenne Nation, said in a statement on Monday. “We celebrate this victory and will continue to advocate on behalf of the Yellowstone grizzly bears until the population is recovered, including within the tribe’s ancestral homeland in Montana and other states.”

The US Fish and Wildlife Service relied on two studies claiming that grizzlies in the Greater Yellowstone area “can remain independent and genetically self-sufficient,” but only if new genetic material is introduced.

Genetic health is a key metric for deciding whether a species should be listed. In the grizzly bear’s case, human stressors have stunted genetic diversity, geographically isolating them and preventing interbreeding with other populations.

“We’re glad the court sided with science instead of states bent on reducing the Yellowstone grizzly population and subjecting these beloved bears to a trophy hunt,” Bonnie Rice, senior representative for Sierra Club’s Our Wild America Campaign, said in a statement.

Republicans have long tried to change endangered species laws and remove protections from certain animals. In 2015, several Republican senators introduced bills that would delist more than 800 species—setting a five-year expiration date on endangered species protections and removing them from animals such as the polar bear—and make it harder for new ones to get listed.

When the decision to delist Yellowstone’s grizzly bears was announced, Interior Department Secretary Ryan Zinke called it “very good news,” though many conservationists saw it as a political play to please hunters.

Grizzly bears in the Greater Yellowstone area have been protected under the Endangered Species Act for 42 years. The US Fish and Wildlife Service unsuccessfully tried to delist the species once before in 2007 but a federal judge ruled against it.