Those 700 or so grizzly bears around Yellowstone and Grand Teton National Parks are safe — at least for now.

A federal appeals court in San Francisco ruled this past week that the bears living in the Greater Yellowstone Ecosystem — which includes 34,000 square miles in parts of Montana, Idaho and Wyoming — will remain federally protected under the Endangered Species Act.

The decision, issued Wednesday by the Ninth U.S. Circuit Court of Appeals, affirmed a 2018 District Court ruling that required the U.S. Fish and Wildlife Service to put grizzly bears back on the endangered species list after the agency removed them in 2017.

The ruling means it is still illegal to hunt grizzly bears for sport in the designated area. The issue has been a source of contention and lawsuits for more than a decade.

In her decision, Judge Mary Schroeder echoed the District Court’s ruling. Delisting the grizzly bears failed to consider the long-term genetic effects on other grizzly bear populations across the country, she wrote. The court also ordered the Fish and Wildlife Service to “conduct a ‘comprehensive review’ of the remnant grizzly population.”

The decision to delist the grizzly bear violated the Endangered Species Act because it was “the result of political pressure by the states rather than having been based on the best scientific and commercial data.”

Environmentalists and Indigenous tribes involved in the lawsuit said the appeals court decision was a modest victory for the grizzly bear, but added that they expected further efforts by the federal government to have it delisted in the future.

A spokesman for the Fish and Wildlife Service said that the agency is disappointed in the ruling and “continues to believe, based on the best available science, that grizzly bears in this ecosystem are biologically recovered and no longer require protection under the Endangered Species Act.”

The agency did not immediately respond on Friday to questions about the possibility of further attempts to delist the grizzly bear.

“The grizzly is foundational to many Indigenous cultures,” said Rain Bear Stands Last, who assisted plaintiffs with the lawsuit and is the executive director of the Global Indigenous Council, a body of Indigenous tribes from around the world. “Had the decision gone against tribes,” he said, “it would have set a devastating precedent.”

In 2017, the Fish and Wildlife Service removed the grizzly bear from its list of endangered species, prompting conservation groups, tribes and individual citizens to sue. The delisting was overturned in District Court a year later, which forced Wyoming and Idaho to cancel planned grizzly bear hunts. (Hunting grizzly bears is not allowed in Yellowstone or Grand Teton National Parks.)

Those in favor of delisting the grizzly bear, including the Fish and Wildlife Service, point to the increased grizzly population as a conservation success story, but one that can pose threats to livestock and humans.

The Wildlife Service was joined in the lawsuit by the states of Idaho, Montana and Wyoming, and private hunting and farming organizations including the Safari Club International and the National Rifle Association of America.

Environmentalists argue that more needs to be done to protect the grizzly and that climate change and a fluctuating food supply could lead to a population decrease.

Sarah McMillan, a spokeswoman for WildEarth Guardians, a conservation group involved in the lawsuit, said allowing hunting outside the park would prevent interaction between groups of grizzly bears across the country, jeopardizing the long-term viability of all North American grizzlies.

“It’s like a kill zone right outside Yellowstone National Park, and those are exactly the kind of bears that need to be dispersing and providing that genetic connectivity,” she said. “So it’s not just the individual bears being killed — even though I and many others find that appalling — it’s that it puts the Greater Yellowstone Ecosystem population at risk of the extinction vortex.”

The Greater Yellowstone Ecosystem and the Northern Continental Divide Ecosystem, located in Montana, contain two of the largest populations of grizzly bears in the country, she said, but there has not been a record of interaction between those populations in years.

Around 50,000 grizzly bears once roamed North America from Canada to Mexico. When they were placed on the endangered species list in 1975 there were only a few hundred. A viable population would be 5,000 to 10,000, McMillan said, a small fraction of the former population.

But the ultimate goal is full recovery for the grizzly bear and eventual removal from the list.

“None of us wants the grizzly bear to be on the list, because that means they’re imperiled,” McMillan said. “I want them to be recovered and off — and they won’t need the protection of the Endangered Species Act.”