A federal judge has temporarily blocked Texas' tough new "sanctuary cities" law backed by the White House that would have allowed police to inquire about immigration status and impose jail time for not cooperating with federal immigration authorities.

The law, known as Senate Bill Four, had been cheered by US President Donald Trump's administration and was set to take effect on Friday.

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.

Wednesday's ruling by US District Judge Orlando Garcia in San Antonio was handed down as 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.

READ MORE: Trump order on sanctuary city funding blocked in court

Garcia wrote in his 94-page ruling that Texas' law was pre-empted by existing federal statute and was therefore unconstitutional.

He also noted there "is overwhelming evidence by local officials, including local law enforcement, that SB 4 will erode public trust and make many communities and neighborhoods less safe" while adding that "localities will suffer adverse economic consequences which, in turn, will harm the state of Texas". 

Republican Governor Greg Abbott, who signed the law in May, said Texas would appeal immediately and expressed confidence that the state would eventually prevail.

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.

The law had sought to fine law enforcement authorities who fail to honour federal requests to hold people jailed on offences that are not immigration-related for possible deportation.

It also would have ensured that police chiefs, sheriffs and constables could face removal from office and even criminal charges for failing to comply with such federal "detainer" requests.

The Constitution vs. Trump - People and Power

Source: News agencies