(AP) — A federal judge said gray wolf hunts can go on for the first time in decades in the Northern Rockies, just months after the animals were removed from the endangered species list.

U.S. District Judge Donald Molloy denied a request by environmentalists and animal welfare groups to stop the hunts in Idaho and Montana, saying plans to kill more than 20 percent of the estimated 1,350 wolves in the two states would not cause long-term harm to the species.

The wolf population could sustain a hunting harvest in excess of 30 percent and still bounce back, Molloy said in his written ruling issued late Tuesday.

The ruling left unresolved the broader question of whether wolves should be returned to the endangered list. However, Molloy said the U.S. Fish and Wildlife Service appeared to have violated the Endangered Species Act when it carved Wyoming out of its decision to lift protections in May for wolves elsewhere in the region.

That suggests environmentalists could prevail in their ongoing lawsuit seeking to restore protections for the predator. "The service has distinguished a natural population of wolves based on a political line, not the best available science. That, by definition, seems arbitrary and capricious," Molloy wrote in his 14-page ruling.

Attorney Doug Honnold, who argued the case on behalf of groups opposed to the hunts, offered a mixed reaction to the ruling. "If they violated the Endangered Species Act, then this population eventually is going have to go back on the (endangered) list," Honnold said.

He also said he was disappointed that the injunction request was denied and "took no comfort" in Molloy's statement that the population could withstand a hunt. A decision on whether to appeal Molloy's ruling could be made by Thursday.

Fish and Wildlife spokesman Joshua Winchell said the ruling confirmed the region's gray wolves have recovered, at least in terms of sheer numbers. But he acknowledged that it also raised more far-reaching legal issues.

"Obviously, we want to make sure we're doing right by the law, too," Winchell said, adding the agency would consult with the Department of Justice on the issue.

Hunters in Idaho have so far reported taking four wolves since hunting opened there on Sept. 1. That includes a wolf pup that authorities said was shot illegally on Sunday from behind a pickup truck in an area closed to hunting. The name of the hunter, who was cited for poaching, was not released. Authorities seized his camera and wolf tag along with the pup's hide and skull. It's illegal in Idaho to hunt from a public road.

Idaho has a quota allowing as many as 220 wolves to be killed. Montana's season is set to begin Sept. 15, with a quota of 75 wolves.

Wolves once roamed North America but by the 1930s had been largely exterminated outside Alaska and Canada. An estimated 1,650 of the animals now live in the Northern Rockies — the result of a contentious $30 million reintroduction program that began in 1995. The population is now five times the original recovery goal set in the 1990s.

Hunt opponents say those gains could quickly be reversed without federal protections. But as wolf numbers have grown, so have attacks on domestic livestock, ratcheting up the pressure to keep the population in check.

Last month, a small pack of wolves in southwestern Montana killed 120 sheep in a single incident — one of the largest such attacks to date.

Montana Fish, Wildlife and Parks spokesman Tom Palmer said his agency will proceed with the hunt in that state and "show everyone that Montana can manage wolves just like it has managed other wildlife."

Jim Unsworth with Idaho Fish and Game said the hunt there has gone smoothly. "Everything is working just like we planned, which shouldn't be a surprise since we've done this for years with other critters," Unsworth said.

Molloy sided with environmentalists in a similar case that arose last year, after the federal government's first attempt to declare wolves recovered. In that case, the environmentalists successfully argued that a Wyoming law allowing wolves to be shot on sight across most of the state would put the population in peril again.

As a result, the government kept about 300 wolves in Wyoming on the endangered list when it ended that protection in Montana and Idaho this spring.