ALBUQUERQUE, N.M. (AP) — It will be up to a federal judge to determine whether New Mexico is doing enough to meet requirements spelled out in a decadeslong legal battle over the services available to people with developmental disabilities.

The 10th U.S. Circuit Court of Appeals on Tuesday ordered the costly case back to a lower court to determine whether the state is complying with federal law.

It also will be up to the district court to determine whether reforms implemented over the years are enough to protect against future violations and whether federal oversight is still necessary.

The case stems from a class-action lawsuit filed 30 years ago that alleged civil rights violations on behalf of developmentally disabled residents at two state-supported institutions. Those facilities closed years ago, but the state's obligations continue under a series of stipulations and other decrees approved by the district court over the years.

New Mexico has spent more than $50 million related to the litigation — known as the Jackson v. New Mexico case — in the last decade, according to court records. State officials see the appeals court ruling as a positive step that could bring the parties closer to resolving the case.

"State administrators and hundreds of state employees have tackled the issues brought up in the Jackson lawsuit, and over the years (the New Mexico Department of Health) has addressed the violations initially found by the court," agency spokesman Paul Rhien told The Associated Press.

Rhien said the end of the lawsuit would mean the department could funnel money that would have otherwise been spent on the legal battle to programs and services for the developmentally disabled.

Plaintiffs argue that federal oversight is still necessary because the state has yet to fulfill its obligations.

In rejecting New Mexico's effort to end the case, the appeals court found that the lower court in 2016 took a narrow view that centered on the specifics of the obligations spelled out in the decrees rather than if the state was in compliance with federal law.

The appeals court said the obligations are a means to accomplishing the goals of improving the system, not the end. It also cited previous decisions by the U.S. Supreme Court that determined federal consent decrees should do no more than remedy violations of federal law and that a flexible approach must be taken.

New Mexico has argued in court documents that under the decrees, the number and complexity of its responsibilities have increased and that the obligations are ever-changing and ever-increasing. The state also has pointed to the rising costs of providing services to people with developmental disabilities.