Updated

In a new ruling, a federal appeals court has upheld most of Texas law targeting sanctuary cities in what some are calling the toughest state-level immigration measure in the country.

Tuesday’s ruling by the Fifth Circuit Court of Appeals in New Orleans allows police officers in Texas to ask people their immigration status during routine stops.

It also threatens officials with jail time for not cooperating with federal immigration authorities.

Republican Gov.  Greg Abbott quickly took to Twitter to announce that the “law is in effect” and that “allegations of discrimination were rejected.”

Texas Attorney General Ken Paxton also released a statement, applauding the decision and saying “dangerous criminals shouldn't be allowed back into our communities" to potentially commit more crimes.

Tuesday’s ruling came just as President Donald Trump visited California to view prototypes for a border wall to better secure the nation's southern borders.

“We are going to confront dangerous sanctuary cities,” Trump said during his visit. “I am calling on Congress to deliver a budget that protects our homeland and properly funds all of our law enforcement needs.”

The Associated Press contributed to this report.