ARTICLE AD BOX
Texas has been ordered to move floating buoys that it placed on the Rio Grande River to stop migrants from crossing into the US from Mexico.
A federal judge ruled the buoys were a threat to safety and diplomatic ties.
He asked the state to move them out of the water and on to the riverbank by 15 September.
The lawsuit was filed by the Biden administration, which sued Texas over the water barriers, citing humanitarian and environmental concerns.
Texas officials said they plan to appeal against Wednesday's ruling.
"Today's court decision merely prolongs President Joe Biden's wilful refusal to acknowledge that Texas is rightfully stepping up to do the job that he should have been doing all along," Governor Greg Abbott, a Republican, said in a statement.
In his ruling, US District Judge David Ezra, an appointee of former President Ronald Reagan, questioned whether the buoys had even been effective in deterring migrants from crossing.
He wrote there was no "credible evidence that the buoy barrier as installed has significantly curtailed illegal immigration".
Judge Ezra also rejected the state's justification for installing the barriers, and raised concerns that its actions could harm relations between the US and Mexico.
US Associate Attorney General Vanita Gupta said the Biden administration welcomed the decision.
"We are pleased that the court ruled that the barrier was unlawful and irreparably harms diplomatic relations, public safety, navigation, and the operations of federal agency officials in and around the Rio Grande," Mr Gupta said.
Texas began installing the buoys in July, saying they were expected to eventually cover about 1,000ft (305m) of the Rio Grande River.
The floating barrier was placed in the Eagle Pass area, which has seen about 270,000 migrant detentions this fiscal year.
Immigration advocates said it would be ineffective and potentially dangerous to migrants.
The Biden administration filed its lawsuit against Texas over the buoys in late July, arguing that by installing the barrier the state had violated federal laws governing navigable waterways.
The floating barrier is just one part of what is known as Operation Lone Star - a series of projects aimed at curbing migration into Texas from Mexico.
As part of the operation, Texas has also installed a 60-mile razor wire fence, which was criticised by Mexican officials as violating international law.