Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A Texas bill that forces police departments to join a federal crackdown on illegal immigration has one big problem.

The cops, by and large, don't want any part of it.

The rift could represent a new front in the nationwide fight over the Trump administration's attempt to round up and deport people who are in the country illegally, particularly those charged with crimes.

Last month, U.S. Attorney General Jeff Sessions said lax immigration enforcement was driving up crime in so-called sanctuary cities, angering some law enforcement officials, including New York's police chief. In March, the Justice Department published a list of departments that had declined federal requests to detain undocumented immigrants, singling out Travis County, Texas as one of the worst offenders. (The county includes Austin, the state capital and an unusual bastion of Texas liberalism.)

Police officials across Texas, from big cities to border counties, have warned that the new measure, known as SB4, would prevent them from keeping their immigrant-heavy communities safe, undermining criminal cases and destroying relationships with marginalized people, including victims and witnesses. Someone who has been the victim of a crime, or has witnessed a crime, may be reluctant to come forward and help the police solve a case if they are worried about being deported, they say. The police also complain that they're being forced to do more work without being paid for it, costs that could be passed along to taxpayers.

Related: Texas Bill to Ban ‘Sanctuary Cities’ Heads to Governor’s Desk

In joint statements and newspaper op-eds and interviews, the police officials have lambasted the bill ─ which the state legislature approved this week, and which Gov. Greg Abbott says he'll sign.

Dallas police stand guard during a march through downtown Dallas on April 9 to call for an overhaul of the nation's immigration system and end to what organizers say is an aggressive deportation policy. LM Otero / AP

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

"It's political theater to feed the extreme on this issue," Houston Police Chief Art Acevedo said Thursday. "But sadly, that political theater, which may create the perception to the extreme right that police have become (U.S. Immigration and Customs Enforcement) agents, is the same theater being played and watched and viewed by the immigrant community. They’re going to go further into the shadows, and that will impact the safety of all Texans."

James McLaughlin, executive director of the Texas Police Chiefs Association, said his group was particularly galled by the bill's penalties, including possible jail time for a chief or sheriff who violates its provisions.

He also said the bill also prohibits chiefs from preventing officers from asking the immigration status of people they've stopped ─ but not arrested.

Related: Texas Rep. Opens Up About Emotional Plea to Colleagues Voting on ‘Sanctuary City’ Ban

"That kind of flies in the face of the management of a police agency," McLaughlin said. "Let's not hang around asking people who jaywalk and decide who may be here illegally. Instead, let's go work."

He said the bill could also be challenged as unconstitutional.

SB4 allows law enforcement officers to ask about the immigration status of anyone they detain for any reason. And it requires local police chiefs and sheriffs to obey federal demands to hold suspects for possible deportation.

In addition to jail, the bill allows for chiefs and sheriffs who violate the provisions to be assessed civil penalties or be removed from office.

Texas State Sen. Charles Perry, who authored SB4, accused the opponents of spreading "misinformation" about the bill, which was aimed at stopping people like Travis County Sheriff Sally Hernandez, who has promised to limit her office's compliance with detainer requests from U.S. Immigration and Customs Enforcement.

Texas state Sen. Charles Perry Eric Gay / AP file

Perry said Thursday that the bill wouldn't change departments' operational requirements "one iota." The measure, he said, "does say that whatever the law of the land is, then you have to live by it and you have to implement it."

He also noted that the bill includes protections for victims and witnesses who do not want to reveal their immigration status. It will be up to police departments to make sure that provision is understood by the public, he said.

"If it is properly messaged, the immigrant community will feel safer," Perry said.

Acevedo did not dispute that the bill would not impact the way his department worked.

The damage, he said, would be in the perception.

The fear of police acting as immigration agents could marginalize people who already feel unable to assimilate into American society. That puts them at greater risk of joining gangs or extremist groups, Acevedo said.

"Why are we passing this law if it will have no impact other than to create the perception, create fear?" he said. "If that’s what were trying to do, scare people, then shame on us."