Texas has taken the unusual step of preemptively suing to stop lawsuits challenging its new "sanctuary cities" ban.

Attorney General Ken Paxton's office filed the federal lawsuit Sunday, the same night Republican Gov. Greg Abbott signed it into law.

The lawsuit targets immigrant rights groups and local officials who are likely to challenge the law.

Paxton traveled to Tyler for a speaking engagement on Monday and spoke with CBS19.

“We're asking the courts to determine this is a constitutional bill so we can go forward enforcing it,” he said.

The law, which is slated to take effect in September, would let police officers ask people about their immigration status during routine traffic stops.

Paxton argues that it is constitutional and vital to security the state's border with Mexico. Opponents say it is the nation's most anti-immigrant law since an Arizona crackdown in 2010.

“Arizona had a similar law that passed constitutional muster with the U.S. Supreme Court. Ours is actually more lenient,” Paxton told CBS19. “Theirs required law enforcement ask about immigration status. Ours does not require that. It merely tells police officers that they can ask and that they can't be prohibited from asking.”

Monday night, a Latino rights groups said it had filed what may be the first lawsuit challenging the ban on "sanctuary cities."

Luis Vera is an attorney with the League of United Latin American Citizens. He says he filed the challenge Monday on behalf of a small town near the border with Mexico called El Cenizo, which has had a "safe haven" ordinance since 1999 that prohibits city employees from asking about a person's immigration status.

The ACLU and other groups have also pledged to fight Texas in court over the law.

San Antonio's police chief says the department will abandon a policy prohibiting officers in the nation's seventh-largest city from asking about a person's immigration status due to the enactment of the measure.

The Associated Press Contributed to this story.