A federal judge has blocked a controversial 'sanctuary cities' law set to go into effect in Texas Friday.
The law gave police officers the authority to ask people if they are in the U.S. legally during routine traffic stops.
It also threatened sheriffs with jail time for not cooperating with federal authorities.
The law is viewed as one of the toughest immigration measures in the country.
Despite protests from businesses and other groups, it had passed the Texas Legislature with little trouble.
U.S. District Judge Orlando Garcia delivered the ruling late Wednesday in San Antonio, saying, "The state may not exercise its authority in a manner that violates the United States Constitution."
Anxieties about immigration enforcement have flared as Texas deals with evacuees from Tropical Storm Harvey. Houston officials took steps to assure families fleeing the floodwaters that shelters would not ask for their immigration status.
Texas Gov. Greg Abbott says he will appeal the judge's decision.
And he took a swipe at Travis County's Democratic sheriff, Sally Hernandez, who announced this year that her Austin jails would not cooperate with the Trump administration on immigration.
"Today's decision makes Texas' communities less safe. Because of this ruling, gang members and dangerous criminals, like those who have been released by the Travis County Sheriff, will be set free to prey upon our communities," Abbott said in a statement.