Federal wildlife officials are now under a court order to update a decades-old recovery plan for the endangered Mexican gray wolf, a predator that has struggled to regain a foothold in the American Southwest despite millions of dollars of investment in reintroduction efforts.

An Arizona judge on Tuesday dismissed the concerns of ranchers and others and signed off on a settlement between environmental groups and the U.S. Fish and Wildlife Service.

Under the agreement, the federal agency must update the recovery plan by November 2017 while providing the court and other parties in the case with regular updates on the planning process.

Environmentalists have long argued that the agency had a legal obligation to adopt a recovery plan that spells out specific goals and milestones for returning the wolves to their historic range.

There are currently about 100 wolves in the wild in New Mexico and Arizona.

"This is official," said Bryan Bird of the group Defenders of Wildlife. "We'll have the best available science, and hopefully the Fish and Wildlife Service will move toward increasing the number of wolves in the wild."

The Fish and Wildlife Service said Tuesday that the new plan will be published by the deadline. "Recovery of the Mexican wolf remains our goal. We aim to support natural wild wolf population growth and improve population genetics, eventually leading to species recovery and state management of the species," the agency said in a statement.

Blair Dunn, an attorney for opponents of the settlement, said he was disappointed with the ruling and accused the federal government of catering to special interest groups.

The wolf recovery program, which spans parts of New Mexico and Arizona, has been hampered over the years by legal battles, politics and other issues. Environmentalists have pushed for the release of more captive wolves into the wild, but ranchers and local leaders have protested over concerns about livestock losses and public safety in rural communities.

Federal investigators concluded earlier this year that the Fish and Wildlife Service mishandled the recovery program, backing up claims by one New Mexico county that the agency was not cooperating with ranchers and protected wolves even after they preyed on cattle.

U.S. District Judge Jennifer Zipps wrote in her order that the settlement was the product of fair and careful negotiations and that it did not set forth any specific provisions for recovering the species but only established a deadline for when the plan will be completed.

Michael Robinson with the Center for Biological Diversity said he doubts a recovery plan would have been formalized without legal pressure. He pointed to a handful of cases in which efforts to update the initial plan from 1982 stalled and ultimately failed.

"It's clear that without court enforcement, the plan would have kept being right around the corner until the Mexican gray wolf went extinct," he said.

The ruling could also affect an appeal that involves New Mexico's denial of a permit to the federal government to release more wolves. The legal action was spurred by state concerns about the direction of the reintroduction program and the failure of the federal agency to revamp the outdated recovery plan.