A federal judge in New Mexico tossed out a lawsuit from environmental groups that claimed oil and natural gas production was encroaching on the Chaco Culture National Historic Park, known for ancient ruins and pueblos.

In his final judgment Judge James Browning dismissed all of the claims under the National Environmental Policy Act (NEPA) and the National Historic Preservation Act (NHPA), with prejudice, against the U.S. Bureau of Land Management, dismissing activists’ claims.

The plaintiffs—Diné Citizens Against Ruining Our Environment, San Juan Citizens Alliance, WildEarth Guardians, and Natural Resources Defense Council—filed the lawsuit in 2015 against BLM and then-Interior Secretary Sally Jewell for approving and issuing drilling permits in the San Juan Basin in Northwest New Mexico.

The group of Native American’s and environmental groups alleged the oil and gas development was encroaching on the historical park, and that BLM had violated NHPA for “failing to consider the indirect effects that well pads would have on Chaco Culture National Historic Park” and violated NEPA by “failing to adequately consider the environmental impacts of hydraulic fracturing and horizontal drilling in developing the Mancos Shale in the San Juan Basin.”

Judge Browning concluded that “BLM complied with NEPA’s requirements” and adequately involved the public in the NEPA permitting process, and that “BLM did not violate the NHPA, because it considered the effects on historical sites within the wells’ areas of potential effects.”

Browning’s 132-page decision reversed course on a few items that the judge initially appeared open to in the plaintiffs’ lawsuit, including indirect adverse impacts on the park from nearby wells. The judge limited the government’s requirements to consider historic sites inside or immediately near a well, and not further afield.

“Such a limitation makes sense, as the archaeological site’s historical value stems from the historical data recoverable from the location and not the historical property’s setting or feeling associated with it,” Browning wrote. “Because Chaco Park and its satellites are outside those wells’ APEs [Area of Potential Effect], the BLM was not required to consider the indirect effects the wells would have on Chaco Park and its satellites.”

BLM New Mexico  told Western Wire it did not have a comment on the decision.

“BLM did not violate NEPA, because the BLM appropriately analyzed the impacts of horizontal drilling and hydraulic fracturing,” Browning wrote.

BLM’s 10-mile buffer zone restricting leasing for oil and natural gas development around Chaco Culture National Historical Park, and within the park itself, remains in effect.

The relief could come with new interest and investment in the San Juan Basin compared the state’s booming Permian Basin, located across the state to the southeast. This ruling could lift a key impediment to investment in the region, according to NMOGA.

New Mexico is no stranger to activist-driven lawsuits and other protests that have tied up funds from oil and gas development and endangered the state’s budget.

That included a nearly nine month delay of BLM lease proceeds from a September 2016 quarterly lease sale that saw nearly $70 million withheld from the state budget at a time when the state’s budget faced a crisis, which increased oil and gas revenues helped to end.

Last year, New Mexico’s oil and natural gas producers contributed more than $167 million in competitive lease sale bids on BLM lands, just behind Wyoming in the Rocky Mountain region for overall lease proceeds.

Since the end of 2017, New Mexico now ranks at the United States’ third largest oil producer and ninth largest natural gas producer, according to statistics from the U.S. Energy Information Administration. Royalties from the state’s Land Grant Permanent Fund were estimated at $689 million for the current fiscal year, and projected to reach $740 million by FY 2019. Those funds are distributed to the state’s public schools and universities.