SANTA FE, N.M. — After more than 50 years of litigation, a federal judge has brought an end to a water-rights lawsuit involving four Native American communities and various residents in northern New Mexico.

The lawsuit, known as the Aamodt Case, began in 1966. U.S. District Judge William P. Johnson’s decree on Friday puts an end to it, unless someone appeals — again.

“For people to come together for a resolution and reach a settlement after 51 years is truly monumental,” Santa Fe County Manager Katherine Miller said.

Johnson affirmed a 2010 settlement calling for a regional water system in the Pojoaque Basin. The settlement also puts rules in place for well owners to either tie into the system or continue using their wells.

The Office of the State Engineer released a statement saying the decree “brings certainty to Pueblo and non-Pueblo rights in the valley, and facilitates their administration by the State Engineer.”

The federal government has set a 2024 deadline for substantial completion of the $260 million regional water system, which will divert from the Rio Grande. It will be paid for with federal funds and about $72 million in state funds, of which $15 million already has been paid.

Santa Fe County is obligated to pay $11.7 million, but that doesn’t include an estimated $9 million it will pay after the system is substantially complete to bring water to county residents who elect to hook up with the system.

The lawsuit was originally filed by the state engineer. It was named after R. Lee Aamodt, a landowner and Los Alamos scientist who was the first of more than 1,000 defendants listed in the lawsuit. The case has roiled residents of the Pojoaque Basin north of Santa Fe for decades, as local, tribal, state and federal officials have worked to resolve who has ownership to the water.

Johnson’s decree comes in well under a Sept. 15 federal government deadline for the action and takes the case out of the New Mexico federal district court where it has been contested for five decades. But parties could still appeal to the U.S. 10th Circuit Court of Appeals in Denver. Non-Native American residents have taken the case to the appeals court before.