MCALLEN, Tex. — A judge ruled Wednesday that the federal government can begin surveying land for a border wall on property that houses a small Texas church against the wishes of the local Roman Catholic Diocese, setting up a potentially lengthy fight as the church claims a wall would violate its religious freedom.

The ruling came as the Trump administration appears to be moving forward with plans to access private land for a wall it wants to build along the southern border with Mexico; Trump on Tuesday night during his State of the Union address reaffirmed his desire to build a wall to secure the border and more carefully control immigration.

Along this stretch of southern Texas, Customs and Border Protection now says it will take some residents to court to access their private land as the agency determines whether a border wall can be built on the properties. Protesters are camped in tents near a historic cemetery and a butterfly sanctuary that they argue will be disturbed should a wall be built in the area — and they are facing newly placed excavating equipment that appears poised to begin moving dirt as part of a congressionally approved section of the wall that received funding last year.

Landowners here say they are increasingly on edge as they receive letters indicating the government wants their land along the Rio Grande, and they are poised for eminent domain court battles that in the past have lasted a decade or more.

U.S. District Judge Randy Crane ruled that the surveying of the diocese’s property — work that should take just a few hours — does not constitute a “substantial burden” on the religious function of the 170-year-old La Lomita Chapel, which lines the river in the border city of Mission.

The diocese owns the chapel grounds but leases it to the city as a park. Bishop Daniel Flores has resisted the government surveys on the grounds that any constructed barrier “violates his religious beliefs,” said Mary McCord, a Georgetown University law professor representing the diocese. “The Church believes any access violates the sacred nature of the place.”

John Smith, an assistant U.S. attorney in the Southern District of Texas who works on property issues related to the border barrier, said in court that the government already has received permission to survey neighboring properties and wants to push forward with the church property as part of the assessment process.

Smith said the church parcel is “the last section we don’t have right of entry” to in the area, which is near the riverfront county park where Trump viewed the Rio Grande during a visit in January. Smith said the federal government has no intention of disrupting religious activities at the chapel once a barrier is built.

The first nearby construction of the new barrier is slated to begin shortly on a levee that cuts through two federal wildlife refuges upstream from the chapel.

As he has in other recent hearings to allow surveyors onto private property, Crane sided with the government. Noting that he visits the chapel, Crane said he “can’t see that allowing a few people on to do some surveying works is a substantial burden. Certainly the government’s entitled to have some survey work done.”

McCord said after the hearing that the church could not, in good conscience, grant access to the surveyors without a court order. The real battle for La Lomita, she said, will come if and when the government moves to take the property.

“This really is just step one,” McCord said.

In January, four Democratic U.S. senators wrote to Homeland Security Secretary Kirstjen Nielsen, arguing that “eminent domain should not be invoked in violation of any religious organization’s First Amendment right of free exercise of religion, Fifth Amendment right to just compensation for any public taking of private property, or the Religious Freedom Restoration Act.”

The proposed wall also would split the National Butterfly Center Refuge in Mission and the Bentsen-Rio Grande Valley State Park. The preserves, along with the Santa Ana National Wildlife Refuge — where Congress has prohibited building a wall — attract naturalists and birding and butterfly enthusiasts, pumping several hundred million dollars a year into the local economy.

On Tuesday, protesters, many of whom identify as members of the Carrizo-Comecrudo, a small indigenous tribe that traces its roots to communities along the Rio Grande that predate Spanish colonization, gathered in tents near a century-old cemetery.

Christopher Basadú said the requirement of a 150-foot perimeter on either side of the wall would mean that the cemetery would have to be removed. Though no indigenous remains are in the cemetery, the activists have made common cause with the local families who stand to lose their ancestors’ burial grounds, he said.

“The construction of the wall will disturb sacred ground,” Basadú, 46, said as he walked amid the gravestones. “These are indigenous homelands. We are not claiming ownership of the property in the legal sense. But this is our ancestral homeland, our sacred responsibility.”

The butterfly sanctuary has threatened to sue if the government attempts to take its land, and the appearance of excavating equipment and trucks near its property this week raised alarms that the government might have been trying to build within the refuge. Instead, the equipment was situated in proximity to federally owned land where construction is slated to begin.

Dozens of landowners across the area received surprise letters from the federal government in recent months, requesting access to their properties for surveys, soil tests, equipment storage and other actions. Lawyers involved in the cases and experts said it is the first of a two-step process the government uses in cases of eminent domain — in which the government tries to seize private land for its purposes. Some landowners already have declined to allow the government on their properties.

Some received a second letter in late January stating that the government plans to serve them with a declaration that would allow it to access their properties for 12 months.

“The Government has an immediate need to enter your property to conduct the necessary surveys,” the letter reads. “Border security tactical infrastructure, such as border walls, lighting and roads, are critical elements to gain effective control of our nation’s borders.”

A spokesman for Customs and Border Protection did not immediately respond to a request for comment.

Yvette Gaytan said she gave the government permission to survey on her land, a parcel that is just smaller than an acre, where she lives in a three-bedroom home with her husband, three children and two dogs. Despite her agreement, she said she received one of the government’s demand letters within the past few weeks.

Her family has owned the land for generations. Her teenage children are now terrified that they might have to move. And she is trying to figure out her next steps.

“It’s not big,” she said. “It’s not a palace. It’s my home.”

Zezima reported from Washington. Althaus is a freelance journalist based in Texas.