The Catholic Diocese of Brownsville must allow the Trump administration to survey land around the 120-year-old historic La Lomita Chapel to potentially make way for the president’s proposed border wall, a Texas judge determined Wednesday.

But the administration’s seeming victory toward securing land for the wall comes with one major caveat: The pre-border surveying will be under terms set by the diocese.

“Honestly, we expected the judge to rule this way, but we are pleasantly surprised that he allowed the survey to happen on our terms,” Father Roy Snipes, a 73-year-old clergyman who leads a nearby Catholic church, told The Daily Beast on Wednesday. “We are going to continue to fight to ensure the wall isn’t built across our mother church.”

U.S. District Judge Randy Crane ruled Wednesday in the Texas Southern District Court that the government’s access to survey land surrounding the historic “mother” chapel, which sits 800 feet from the southern border, must be negationated by both parties.

Crane did not, however, rule on what would happen if the survey—the first step toward wall construction—determines the church-owned land is necessary to seize for building the barrier.

“As the Diocese recognizes, the more substantial burden—which it believes will violate its right to religious exercise under the Religious Freedom Restoration Act—will come if and when the government seeks to take the property for the building of a wall cutting off La Lomita from those who worship there,” Mary McCord, the diocese’s attorney and a senior litigator for the Georgetown’s Institute for Constitutional Advocacy and Protection, told The Daily Beast on Wednesday.

McCord admitted the decision was expected, and argued in court that the border wall violated the church’s religious freedom by restricting church to La Lomita Chapel.

As previously reported by The Daily Beast, the diocese has called the wall “fundamentally inconsistent with Catholic values” and stated Trump’s plans could limit access to or totally destroy the chapel, which has served as the religious heart of Mission, Texas for more than a century.

In response, the government’s attorneys assured that wall construction would leave the church usable by both Texans and their southern neighbors intact.

“We have no desire to go into the chapel,” the federal attorney said, according to court reporters.

While the border wall may not ultimately disrupt access to the single-room structure in the middle of an open field, Bishop Flores, who has led the diocese since 2009, believes that a wall near the house of worship would be enough to burden the “sanctity of church.”

If the government were to use eminent domain to secure the land around La Lomita, Flories argued, the lights from the 150-foot enforcement zone would be enough to violate religious rights.

“La Lomita has always been known as a safe and welcoming place for everyone, despite their citizenship status, race, gender, or ethnicity,” Flores said. “It hinders the religious freedoms of residents in the area and across the border who may be scared to go through. It ruins the sanctity and purpose of church.”

As one of the five border dioceses, Brownsville’s unique placement next to the Rio Grande could give customs and border-patrol officials the opportunity to monitor and interrogate churchgoers on their immigration status, the diocese argued, thus violating their First Amendment rights.

“Even this temporary access is an intrusion on those using the chapel for prayer,” McCord said. “This is just the first step in our fight to protect the Rio Grande Valley Catholic community’s right to free exercise of religious beliefs.”

McCord anticipates the church and federal officials will begin talks on entry restrictions by the end of the week, where the focus will be on protecting La Lomita to ensure worship at the chapel is not interrupted.

The plea for religious freedom even reached the U.S. Capitol, as three congressman added new language preventing wall funding for protected areas to the Democratic proposal to end last month’s partial government shutdown.

The proposal sought to protect five historical and cultural landmarks, including La Lomita Chapel, by prohibiting any funds for any physical barrier around these sites.

“This is a big win for South Texas,” Congressman Henry Cuellar (D-TX) said in a statement last month. “I worked hard to include this language because I know we can secure the border in a much more effective way, and at a fraction of the cost, by utilizing advanced technology and increasing the agents and properly equipping them on the border.”

Four top Democrats also sent a letter to Department of Homeland Security Secretary Kirstjen Nielsen last month to question the administration’s plan to use eminent domain to seize land from border-town religious groups.

“Eminent domain should not be involved 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 senators wrote.

A DHS spokesperson declined The Daily Beast’s request for comment on whether the agency ever responded to the letter.