ALBUQUERQUE, N.M. (AP) — A U.S. court has sided with a New Mexico ranching family in a decades-long battle over access to water on national forest land, providing more certainty that state law allows for the protection of water rights dating back more than a century.

The case of the Goss family has been closely watched by thousands of ranchers who hold grazing permits across the West. Attorneys and others say the outcome could have ripple effects on ranchers and rural communities that have often complained about federal land managers trampling property rights.

The Goss family claimed the federal government violated its constitutional rights by not providing just compensation after condemning property — in this case water rights that had been established before Lincoln National Forest was created.

U.S. Court of Federal Claims Chief Judge Susan Braden agreed. On Friday, she ordered the family and the U.S. Forest Service to determine whether alternative water sources are available that can allow the family — operating as the Sacramento Grazing Association Inc. — to operate a viable cattle business.

Braden must still determine how much compensation the family is owed.

Regional officials with the U.S. Forest Service declined to comment pending a final judgment.

Michael Van Zandt, a California attorney who represents the family, said Tuesday the family has been working for the past few years with the U.S. Forest Service to find alternative sources of water but those efforts have not always been successful.

The grazing operation was forced to decrease its herd as forest officials fenced off more areas over the years due to habitat concerns and endangered species.

"It's been a huge financial burden to the Gosses," Van Zandt said, noting that his clients were ecstatic about the ruling.

Ranchers around New Mexico said they were excited but cautious given their somewhat tumultuous history with federal land managers. Hispanic ranchers in the north have often complained that federal officials have discriminated against them despite policies that recognize their cultural and traditional ties to the land. Some families have worked the land since the Spanish colonized what is now New Mexico hundreds of years ago.

Braden's ruling made reference to several dozen ranchers who unsuccessfully attempted to find common ground with environmental groups and officials from Oregon's Malheur National Wildlife Refuge for over a decade.

The ruling noted that in January 2016, the ranchers decided to take up arms to protest federal policy and regulations that prioritize water habitat for migrating birds by limiting the number of cattle that historically grazed and used water in the area.

Rather than take up arms, the Sacramento Grazing Association filed a complaint in federal claims court to affirm its right to the beneficial use of stock water on the grazing allotment in Lincoln forest — a right that predated federal control, the ruling said.

The judge found that the Forest Service has responsibility for managing national forests, including the habitat of endangered species, but that a small, family-owned cattle ranch should not be forced to bear the entire financial burden of the agency's management choices where they interfere with property rights recognized by state law.

The Office of the State Engineer, which handles water rights issues, said the ruling recognizes that over the past 110 years, New Mexico has lived under the doctrine that beneficial use of water makes for the establishment of a water right.

"The decision affirms this doctrine and gives certainty to ranchers in the state that protects their water rights and the way they have been ranching in New Mexico since before statehood," water agency spokeswoman Melissa Dosher-Smith said.