Austin - A US federal judge late on Wednesday temporarily blocked most of Texas' tough new "sanctuary cities" law that would have let police officers ask people during routine stops whether they're in the US legally and threatened sheriffs with jail time for not co-operating with federal immigration authorities.The law, known as Senate Bill 4, had been cheered by US President Donald Trump's administration and was set to take effect on Friday, August 1.It was widely viewed as the toughest immigration measure in the nation since Arizona passed what critics called a "Show Me Your Papers" law in 2010, which was later partially struck down by the US Supreme Court.The ruling by US District Judge Orlando Garcia in San Antonio was handed down as anxieties about immigration enforcement in Texas have again flared in the wake of Tropical Storm Harvey.Houston officials have sought to assure families fleeing the rising floodwaters in the nation's fourth-largest city that shelters would not ask for their immigration status.'That's a break'Houston police Chief Art Acevedo, an outspoken critic of the law, got word of the decision while standing inside a downtown convention centre where about 10 000 people have sought shelter. He high-fived another officer."We needed a break. That's a break for us," said Acevedo, whose department has conducted thousands of high-water rescues and lost one officer who died in floodwaters as he tried to drive to work.The measure sailed through the Republican-controlled Legislature despite months of protests and opposition from business groups, which worried that it could cause a labour-force shortage and send a negative economic message.Leading the lawsuit were Texas' largest cities - including Houston, Dallas, San Antonio and Austin - in a state where the Hispanic population has grown at a pace three times that of whites since 2010.Garcia wrote in his 94-page ruling that Texas' law was pre-empted by existing federal statute and therefore unconstitutional.The judge noted that when it was being considered in public legislative hearings, only eight people testified in favour of it while 1 600 "showed up to oppose it".He also wrote there "is overwhelming evidence by local officials, including local law enforcement, that SB 4 will erode public trust and make many communities and neighbourhoods less safe" while adding that "localities will suffer adverse economic consequences which, in turn, will harm the state of Texas."The court cannot and does not second guess the Legislature," Garcia wrote. "However, the state may not exercise its authority in a manner that violates the United States Constitution."AppealGarcia's order suspends the law's most contentious language while suggesting that even parts of the law that can go forward won't withstand further legal challenges.Republican Governor Greg Abbott, who signed the law in May, said Texas would appeal immediately and expressed confidence that the state would eventually prevail.He also again took a swipe at the elected Democratic sheriff of Travis County, Sally Hernandez, who had announced on the day of Trump's inauguration that her Austin jails would no longer automatically honour all detainer requests made by US Immigrations and Customs Enforcement."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.The US Department of Justice, which has made "sanctuary cities" a new priority under the Trump administration, had joined Texas is defending the law in court.US Attorney General Jeff Sessions has threatened to pull federal money from jurisdictions that hinder communication between local police and immigration authorities and has praised Texas' law.