An undocumented immigrant from El Salvador is searched on the tarmac prior to boarding an MD-80 aircraft for a repatriation flight of 80 immigrants to their home country, Tuesday, June 26, 2012 at Phoenix-Mesa Gateway Airport in Mesa, Ariz. Associated Press/Matt York Texas is nearing final approval of a contentious bill that would ban so-called "sanctuary cities" in the state, and it has drummed up a fierce backlash both within the state and across the country.

The bill, SB 4, would allow local officials to be charged with a Class A misdemeanor if they knowingly fail to comply with a federal request from Immigration and Customs Enforcement (ICE) to detain a suspected unauthorized immigrant who was arrested on charges unrelated to immigration.

Officials subject to such charges would include police chiefs, sheriffs, constables, and jail administrators, who could face fines or even jail time if convicted.

The bill's critics are numerous — including Democrats, immigration advocates, religious leaders, and police chiefs themselves, who could be penalized if they refuse to enforce federal immigration law.

Under current federal law, localities are not required to honor ICE detainer requests, also known as detainers, unless they are accompanied by warrants signed by judges. Federal courts have even ruled in the past that honoring detainers can violate detainees' Fourth Amendment rights.

But Texas' bill would change the optional nature of detainer requests, and would also allow police to question people on their immigration statuses if they have been arrested or detained, a practice that Texas police chiefs say would provoke fear and distrust of police within immigrant communities.

"Broad rules, such as those imposed by SB 4, that push local law enforcement to take a more active role in immigration enforcement will further strain the relationship between local law enforcement and these diverse communities," police chiefs in Dallas, Austin, Houston, San Antonio, Fort Worth, and Arlington wrote in a letter opposing SB 4 that was published in several Texas newspapers this week.

"Such a divide between the local police and immigrant groups will result in increased crime against immigrants and in the broader community, create a class of silent victims, and eliminate the potential for assistance from immigrants in solving crimes or preventing crime."

Anger over the bill came to a head Monday, after roughly two dozen protesters were arrested on trespassing charges following an hours-long sit-in outside Texas Gov. Greg Abbott's office, The Texas Tribune reported.

Students gather in the Rotunda at the Texas Capitol to oppose SB4, an anti-"sanctuary cities" bill that already cleared the Texas Senate and seeks to jail sheriffs and other officials who refuse to help enforce federal immigration law, as the Texas House prepares to debate the bill, Wednesday, April 26, 2017, in Austin, Texas. Associated Press/Eric Gay

Texas' bill goes even further than President Donald Trump's executive order on sanctuary cities, which was blocked by a federal judge last month.

Trump's order did not address the issue of detainers beyond mandating weekly lists of jurisdictions that declined them (issuance of those lists has already been halted after multiple jurisdictions said they had been wrongly named), and only threatened to withhold federal grant money from jurisdictions that violate 8 USC 1373, a law regulating the exchange of immigration-related information between local, state, and federal authorities.

Attorney General Jeff Sessions has already indicated that most cities, including the Texas cities of Austin and Dallas, are already in compliance with 8 USC 1373, a declaration that prompted further confusion over how the term "sanctuary city" is defined, and whether Trump's order would affect a single jurisdiction in the country.

SB 4 is now set to go back to the Senate, which could accept the House's version before submitting it to the governor for final approval. Or, the Senate could reject recent amendments made by the House and call for a conference committee to work out a finalized version that would go back to the House and Senate for consideration.

If they pass identical versions, the bill will move on to Abbott, who has indicated he plans to sign it.

Texas Democrats, outnumbered in the Republican-controlled legislature, have vowed to ultimately take their battle to court if SB 4 becomes law, as has the Texas chapter of the American Civil Liberties Union, which in a statement called the bill a "wrongheaded, racist piece of legislation."

"Texas' Latino and immigrant communities will never forget what the Republican Party has done this legislative session to their families," said Manny Garcia, the Texas Democratic Party's executive director, according to The Houston Chronicle.

A division of labor

Texas governor Greg Abbott speaks during an interview on the floor of the New York Stock Exchange July 14, 2015. Reuters/Brendan McDermid

Sanctuary jurisdictions have long faced an uphill battle in Texas, where its Republican-controlled legislature and conservative governor have been emboldened on the issue by the Trump administration.

Earlier this year, Abbott withheld $1.5 million in grants from the Travis County Sheriff's Department, after it implemented a policy to decline all detainers unless they are accompanied by warrants or court orders, or unless the suspects in question are charged with crimes such as murder, aggravated sexual assault, or human trafficking.

"Our jail cannot be perceived as a holding tank for ICE or that Travis County deputies are ICE officers," Sheriff Sally Hernandez said in a video announcing the policy. "The public must be confident that local law enforcement is focused on local public safety — not on federal immigration enforcement.

Abbott responded to her announcement by calling her actions "reckless" and vowed to seek a law that would oust sheriffs who implemented similar policies from office.

Part of the controversy around sanctuary cities is the unclear division of labor between local and federal authorities — police and sheriffs' departments in Texas, as in states across the country, participate in federal immigration enforcement to varying degrees, depending on local policies.

Some jurisdictions argue that sanctuary policies ensure a line is clearly drawn in local officials' responsibilities — they believe local law enforcement officers should enforce only local law and federal authorities enforce federal law. They also believe immigration enforcement is counterproductive in solving crimes, and will dissuade immigrants from reporting crimes or testifying as witnesses due to fears they will be deported.

"Immigration enforcement is a federal obligation. While the federal government has not been able or willing to address this issue, any effort by the state of Texas to address immigration reform will be ineffective," the Texas police chiefs wrote in their letter.

Others jurisdictions, however, believe that it is local police's responsibility to enforce all laws, whether they are local or federal, and honoring detainers will ensure criminals or suspected criminals are detained or deported rather than released back into the community.

Some law enforcement agencies, in the wake of Trump's order, have even sought to expand their enforcement capabilities by applying to a federal program that would allow some officers to be deputized as immigration agents.

"When you look at the function of government — federal, state, or local — our primary function as government is to keep our people safe," Abbott told Fox News on Sunday.

"There are some officials in the state of Texas, as well as across the United States, who simply do not want to apply the rule of law in their jurisdiction, who want to promote lawlessness. And it's inexcusable."