The Trump administration’s plan to crack down on “sanctuary cities,” jurisdictions that limit cooperation with federal immigration agents, is exacerbating longstanding tensions with some local governments and the federal government over immigration enforcement, while also prompting others to alter their policies.

In February, Miami-Dade County voted to end the county’s “sanctuary” status, thereby requiring jail officials to abide by requests made by Immigration and Customs Enforcement to hold some individuals who may be in the country illegally for up to 48 hours. Lawmakers in North Carolina, meanwhile, approved legislation that would strip funding from local governments with “sanctuary city” policies. (The state’s lawmakers banned sanctuary cities in 2015.)

Raising the loudest alarms for immigrant advocates and law enforcement alike, however, is a new policy in Texas. In May, Texas Governor Greg Abbott signed Senate Bill 4, a piece of legislation that penalizes sheriffs, constables, police chiefs, and other local leaders who don’t cooperate with federal immigration authorities or prevent rank-and-file officers from asking about immigration status. Immigrants rights’ activists are concerned the law will lead to racial profiling, and law enforcement officials worry that the law will force them to prioritize immigration violations over other, more serious crimes. While the legislation doesn’t require law enforcement officers to inquire immigration status, it does impose penalties on higher-ups who seek to prevent their officers from asking about it.

“It is a bad day for Texas when officials sworn to enforce the law, want to help people who commit manslaughter and sexual assault evade federal immigration detainers,” said Texas State Senator Charles Perry, the author of the legislation, in a statement. “It is also important to understand that Senate Bill 4, for the first time in state law, protects immigrants who are witnesses and victims of crimes.” Victims and witnesses can be asked about their immigration status if necessary, according to the bill. Still, even the slightest concern about deportation can influence how residents report crime: Earlier this year, Los Angeles Police Chief Charlie Beck announced that the department saw a dip in reporting from the city’s Latino residents, which he attributed to more immigrants being afraid to speak to police.

The Texas legislation, which is scheduled to go into effect in September, places a unique burden on local governments. Elected or appointed officials can be removed from office if they prohibit or limit enforcement or cooperation with federal immigration agents, and the law imposes fines on local governments if they are in violation of the bill—fines range between $1,000 to $1,500 for the first violation and $25,000 to $25,500 for each one after that. Sheriffs, constables, police chiefs, and other local leaders can also face misdemeanor charges if they don’t comply with the legislation. Some of the language, however, is relatively ambiguous. For example, it’s not clear what enforcement would look like and what “pattern or practice” would justify action against a local entity.

Police chiefs, who set the agenda for their departments, are nevertheless concerned that the bill could ultimately intrude upon the way they set day-to-day priorities. “First and foremost, it’s concerning for us when they try to criminalize leadership in this state, when they try to control police departments,” Houston Police Chief Art Acevedo told me. “We, at the local level, are the best to understand the threats of a community, the values of a community, and the priority of a community.”

Austin Police Chief Brian Manley explained that his department only inquires about immigration status if it’s relevant to an investigation or if the individual has been arrested. SB4, however, punishes chiefs who try to prevent their officers from asking about immigration status from those under “lawful detention,” which can qualify as something as simple as a traffic stop.  

Jackson County Sheriff Andy Louderback, meanwhile, argued that legislation creates uniformity. “We support the rule of law. We support the bill.The bill gives us the consistency that that citizenry demands,” said Louderback, the legislative director of the Sheriffs’ Association of Texas. As far as concerns about whether the legislation would undercut officials’ authority, Louderback said, “[The bill] allows us to pursue a criminal issue, a public safety issue, with a clear and consistent message here in Texas and there’s a penalty if you don’t.” This, he said, is important since there are 254 counties in the state and therefore many differing opinions.

Still, the legislation has received pushback from lawmakers and immigrant advocates who’ve drawn parallels to Arizona’s controversial “show me your papers law”—much of which was struck down in a 2012 Supreme Court ruling—and warned that the bill, which includes a clause prohibiting discrimination, could still give way to racial profiling, and strain relations between police and the communities they serve.

The Supreme Court ruled in 2012 that law enforcement can indeed inquire about immigration status under certain circumstances. But the crux of the argument posed by Acevedo, Manley, and others in law-enforcement leadership is that the legislation may strip them of the authority to dictate, to a degree, what officers can and can’t do. “The way the law is written it actually prohibits police chiefs and sheriffs from discouraging their officers from asking that question,” Manley said.

The common practice in Texas is to focus first on the infraction and later inquire about an individual’s citizenship, if necessary, according to Charley Wilkison, the executive director of Combined Law Enforcement Associations of Texas, the largest police officers’ union in Texas.

“We’re going to always prioritize crime fighting over going and harassing day laborers,” Acevedo said. “[Officers] can’t choose to go deal with day laborers that might be undocumented immigrants and only be there solely to check to see if they’re here illegally, while we have calls for service where people and lives are on the balance and are at risk that we prioritize what we focus on.”

Over time, departments across the country have rejected detainer requests because of the cost of detention and the legal implications. For one, detention can be costly, and while jails can technically request money from the Justice Department to make up for the cost, they don’t always follow through, according to Rick Su, a law professor at the University at Buffalo who has researched immigration and local government. Counties can also be held liable if an individual is held unconstitutionally. A 2014 case, known as Miranda-Olivares vs. Clackamas County, serves as an example of this. The court said that detainer requests are discretionary, therefore counties are indeed liable “for any unlawful detention” and therefore also responsible for the costs of lawsuits.

SB4 notes that the state is willing to incur the liability. “It seems slightly interesting that the state is going to take responsibility for that,” Su said. “A lot of it is up to the attorney general. That itself is unique; that itself is a recognition that the rule of local enforcement in this case can be problematic.”

“Police departments and sheriff's departments have a genuine concern that if they’re forced to hold someone even though it may be unconstitutional, that they may be subject to civil-rights violations and liability,” said Edgar Saldivar, senior staff attorney for the ACLU of Texas. The ACLU of Texas and the ACLU Immigrants’ Rights Project have joined a lawsuit challenging the legislation.

Prior to the law’s passage, Acevedo, Manley, and other city chiefs expressed concerns about the text of the legislation in an op-ed published in The Dallas Morning News. “At a time of strained law enforcement budgets and critically low jail space, narrowing the focus to violent criminals, human traffickers, and members of organized crime syndicates is critical,” it reads. “Expecting local law enforcement to prioritize immigration efforts, without adequate funding or increased support from involved governmental agencies, will hinder an agency’s ability to focus its limited resources on the unique needs of the community it serves.”

Of course, fraught relations within communities and between local governments and the federal government are not specific to Texas. In the later years of the Obama administration, the president began backing off interfering at the local level by scaling back 287(g) agreements, which deputize local law enforcement to act as immigration agents, and ending the Secure Communities Program, which required local authorities to share digital fingerprints of individuals booked in jail with federal immigration agents.

President Trump wants to reboot these programs as part of his crackdown on illegal immigration. But local officials’ concerns under previous administrations may also resurface. According to the Pew Research Center, more than 1.6 million undocumented immigrants resided in the state of Texas in 2014. This puts police in a delicate situation, as many of the communities they serve are also made up of immigrants.

The legislation doesn’t take effect until September, so it’s not yet clear how it will be rolled out and what the implications will be for law enforcement leadership. But at the very least, it sets up an uncomfortable confrontation between local governments and the federal government, as part of the administration’s broader immigration-enforcement initiatives.