ARTICLE AD BOX
By Bernd Debusmann Jr
BBC News, Washington
A US federal judge has blocked Texas from implementing SB4, a controversial law that would make border crossings illegal and punishable with jail time.
If implemented, the law will become one of the toughest immigration laws passed by any US state in modern history.
But rights groups and the federal government have sued to stop it.
The state's governor says he will appeal. He is accompanying Donald Trump on a border visit on Thursday, while President Joe Biden makes his own trip.
Governor Greg Abbott said his state would not "back down in our fight to protect our state - and our nation - from President Biden's border crisis".
Mr Abbott has previously alluded to a "tidal wave" of illegal entry into his state. More than 6.3 million migrants have been detained crossing into the US illegally under President Biden - higher than was seen under previous presidencies - though reasons for the spike are complex with some factors pre-dating Mr Biden's time in office.
The proposed law would allow local and state police officers to stop and arrest anyone suspected of having crossed the border illegally, except in schools and hospitals.
Punishments range from misdemeanours to felonies that can lead to jail time or fines of up to $2,000 (£1,580). Penalties for illegal re-entry could go up to 20 years in jail, depending on a person's immigration and criminal history.
The law was set to come into effect on 5 March.
But a legal challenge was mounted by the American Civil Liberties Union and the US Department of Justice - which argues that the legislation would conflict with its own powers.
In an 114-page order published on Thursday, US district judge David Ezra granted a request for an injunction that temporarily prevents Texas from implementing the law.
In his order, Judge Ezra said that legal precedent affirms that "states may not exercise immigration enforcement power except as authorized by the federal government" and that SB4 "conflicts with key provisions of federal immigration law, to the detriment of the United States' foreign relations and treaty obligations".
Additionally, the judge rejected Texas' claim that the state has authority to repel an "invasion" of the territory, saying that "surges in immigration do not constitute an 'invasion' within the meaning of the Constitution."
"[To] allow Texas to permanently supersede federal directives on the basis of an invasion would amount to nullification of federal law and authority — a notion that is antithetical to the Constitution and has been unequivocally rejected by federal courts since the civil war," Mr Ezra wrote.
The controversy of SB4 comes amid rising illegal migration and public concern over Mr Biden's handling of the border.
Both he and his likely contender in the November election, Donald Trump, are scheduled to visit separate border cities in Texas on Thursday.