AUSTIN -- The Republican-backed 'sanctuary cities' ban cleared its final legislative hurdle Wednesday after the Senate voted to agree with the House's changes to the original bill, sending the controversial proposal to Gov. Greg Abbott for his signature.

The bill in question, Senate Bill 4, would grant sweeping new powers to police officers by allowing them to question a person's immigration status if they have been detained with reasonable suspicion. The legislation also would prohibit local jurisdictions from passing or enforcing ordinances that prohibit police officers from inquiring about a detained person's immigration status.

OPPOSITION: Protesters stage sit-in at governor's office over 'sanctuary cities' bill

In a 20-11 party line vote, senators accepted the House version that added several areas where SB 4 would not apply, including government mental health care facilities and hospitals. Among other changes, it also would exclude officers who are contracted by religious organizations and schools, though it will apply to police departments on college campuses.

Calling it a “status quo bill,” GOP Sen. Charles Perry of Lubbock said his SB 4 does not change the way a Texas police officer can detain a person who they suspect could be involved in a crime. He defended the bill from critics who said it will lead to racial profiling and turn Texas police officers into federal immigration authorities.

“Nowhere in the bill as it came back from the House does it instruct officers to demand papers,” Perry said. “Nowhere in the bill does it allow an officer to enforce federal immigration law. Officers still do not have the authority to arrest someone merely for being unlawfully present (in the country), which is a federal power.”

Several Democratic senators challenged Perry's assertions about how the bill would empower police and about the effects SB 4 would have on the immigrant communities in their districts.

AGAINST: Houston police chief speaks out against 'sanctuary cities' bill

“It’s gone from a bad bill to a really, really bad, horrible bill that will result in police officers investigating the immigration status of a person, including children, without probable cause,” said Sen. Sylvia Garcia, a Democrat from Houston. “I’m afraid this legislation will lead to harassment and profiling of Latinos, and this is the last thing any of us would want. ... This bill will go from a broken taillight to a broken family to broken faith in our system.”

In his State of the State address, Abbott deemed a prohibition on so-called 'sanctuary cities' an emergency item for lawmakers this session, a designation that allowed them to begin work on SB 4 at an expedited pace. The governor is expected to sign the bill promptly.

Last week, the House passed SB 4 on a party line vote with 94 Republicans in support and 53 Democrats against it after a nearly 16-hour debate that turned emotional several times. The Senate approved its version, also on a party line vote, in February.

Democrats and progressive groups have promised to file an immediate court challenge to SB 4 after Abbott signs the measure. Attorney General Ken Paxton's office has assured Republican legislators that the bill can withstand such a lawsuit.

“We will let the court systems figure this out,” Perry said.