Editor's note: This story has been updated throughout.

Gov. Greg Abbott signed a ban on "sanctuary cities" into law on Sunday, putting the final touch on legislation that would also allow police to inquire about the immigration status of people they lawfully detain.

"Texas has now banned sanctuary cities in the Lone Star State," Abbott said in a brief video address on Facebook. Abbott signed the bill without advance notice in a five-minute live broadcast on the social media site, avoiding protests a customary public signing might have drawn.

"We're going to where most people are getting their news nowadays and talking directly to them instead of speaking through a filter," said John Wittman, a spokesman for Abbott.

The Texas Tribune thanks its sponsors. Become one.

Senate Bill 4 makes sheriffs, constables, police chiefs and other local leaders subject to Class A misdemeanor charges if they don’t cooperate with federal authorities and honor requests from immigration agents to hold noncitizen inmates who are subject to deportation. It also provides civil penalties for entities in violation of the provision that begin at $1,000 for a first offense and climb to as high as $25,500 for each subsequent infraction. The bill also applies to public colleges.

The final version of the bill included a controversial House amendment that allows police officers to question a person’s immigration status during a detainment — perhaps including traffic stops — as opposed to being limited to a lawful arrest. It has drawn fierce opposition from Democrats and immigrants rights groups, who are already gearing up for a legal battle against the law.

Abbott defended the legality of the law Sunday, saying key parts of it have "already been tested at the United States Supreme Court and approved there."

That could soon come to a test. Sunday night's signing prompted a fast and negative reaction from the Mexican American Legal Defense and Education Fund, or MALDEF, which referred to the new Texas law as "a colossal blunder" and promised to fight it, "in court and out." 

The proposal was one of Abbott's priorities; he listed it as one of four emergency items at the start of the legislative session and it is the first of the four to reach his desk.

He had said it was especially needed after Travis County Sheriff Sally Hernandez announced earlier this year that her department would reduce its cooperation with federal immigration authorities.

The Texas Tribune thanks its sponsors. Become one.

Moments before signing the bill, Abbott also invoked the case of Kate Steinle, a California woman who was killed in a 2015 shooting by a Mexican man who had been previously deported multiples times.

“Kate’s death was more than a murder — it was gross negligence by government policy,” Abbott said. "Texas will not be complicit in endangering our citizens the way Kate Steinle was endangered."

Read related coverage:

Get The Brief

Never miss a moment in Texas politics with our daily newsletter.