The Texas House of Representatives passed a bill Thursday that places a statewide ban on sanctuary cities and allows state officials to jail police chiefs and sheriffs who refuse to cooperate with federal immigration authorities.

The measure also lets police officers inquire about the immigration status of anyone they detain or arrest including the subjects of traffic stops.

The Republican-controlled House approved the bill in a 3 a.m. vote, 81-64, after almost 15 hours of debate. Democrats and some Republicans had objected to the provision allowing police to ask about legal status, but the the bill eventually passed with the support of the House tea party faction.

Other Republican-led states have considered similar laws, but Texas would be the first in which local police officials could face criminal charges and be removed from office for not assisting federal immigration enforcement efforts, the Associated Press reported.

The bill’s supporters argue the provisions are necessary to combat immigrant crime such as drug and human trafficking. GOP Rep. Charlie Geren of Fort Worth, who sponsored the bill, said the measure will “keep the public safe and remove bad people from the street” if enacted.

A similar version of the house bill has already passed in the Texas senate, but the two chambers will have to iron out any differences before sending a final bill to Gov. Greg Abbott.

Abbot designated the issue an “emergency” item in January, and said he will sign an anti-sanctuary bill regardless of the outcome of the judicial battle over Trump’s order.

Texas’ effort to outlaw sanctuary cities comes as the Trump administration’s order to defund such jurisdictions is held up in court. A federal district judge in California issued a preliminary injunction against the order Tuesday. The move temporarily forestalls any attempt to withhold federal funds from cities and states that don’t comply with information-sharing requirements in the immigration code.

Unlike the federal court ruling, Texas has come down on the federal government’s side in the sanctuary city debate.

Follow Will on Twitter. Send tips to will@dailycallernewsfoundation.org.

Copyright 2017 The Daily Caller News Foundation