AUSTIN -- Attorney General Ken Paxton on Monday filed the first lawsuit related to the so-called "sanctuary cities" bill, in preparation for expected legal challenges from immigration groups.

The lawsuit filed under the federal Declaratory Judgement Act, asks a judge to declare S.B. 4 constitutional before any legal challenge is filed.

“This is a public safety issue that requires swift resolution," Paxton said Monday. "If a Texas sheriff or other law enforcement authority cannot lawfully honor an ICE detainer, dangerous people will slip through the cracks of the justice system and back into our communities."

Governor Greg Abbott signed the controversial bill into law Sunday evening on Facebook Live in Austin. The law takes effect on Sept. 1.

Gov. Greg Abbott signs so-called 'sanctuary city bill' into law on Facebook Live.

Groups poised to challenge the law say the move by Paxton will not deter them from proceeding with legal challenges.

The Mexican American Legal Defense and Educational Fund (MALDEF) said the move by the state indicates the "high anxiety" about the legality of the new law, according to Thomas Saenz, president and general counsel of MALDEF.

"We will see you in court, Governor Abbott," Saenz said.