A US federal judge has blocked an order issued by President Trump to deny asylum to migrants crossing the southern US border illegally.
US District Judge Jon Tigar in San Francisco issued the temporary restraining order after hearing arguments by civil rights groups.
Mr Trump signed the order earlier this month in response to the migrant caravan moving towards the border.
He cited national interest concerns but was opposed by civil rights groups.
They brought the San Francisco case, arguing his decision was illegal.
Thousands of migrants from across Central America have been travelling north for weeks towards the US-Mexico border.
They say they are fleeing persecution, poverty and violence in their home countries of Honduras, Guatemala and El Salvador.
In the run-up to the US mid-term elections, President Trump said many of the migrants were criminals, called the caravan an invasion, and ordered troops to the border. He also repeatedly suggested it was politically motivated
What did the judge say?
Judge Tigar, in his ruling, said current legislation made it clear that any foreigner arriving in the US “whether or not at a designated port of arrival” could apply for asylum.
He said Mr Trump’s proclamation on 9 November was an “extreme departure” from prior practice.
“Whatever the scope of the president’s authority, he may not rewrite the immigration laws to impose a condition that Congress has expressly forbidden,” Judge Tigar added.
He was responding in a case brought by The American Civil Liberties Union (ACLU), the Southern Poverty Law Center and the Center for Constitutional Rights.
The judge’s restraining order comes into immediate effect and remains until a court hearing in December to decide on the case.
Why did Trump issue the order?
President Trump’s proclamation on 9 November said anyone wanted to claim asylum in the US had to come in through official points of entry – and their cases would not be heard if they entered illegally.
The ban was to last 90 days or until the US reached an agreement with Mexico to turn back asylum-seekers.
Under US law, there is a legal obligation to hear asylum claims from migrants if they say they fear violence in their home countries – regardless of how they have entered the country.
The Trump administration said the president had the power to “suspend the entry of all aliens” and to impose “any restrictions he may deem to be appropriate on them” if they were judged to be “detrimental” to US interests under the Immigration and Nationality Act.
“Today, we are using the authority granted to us by Congress to bar aliens who violate a presidential suspension of entry or other restriction from asylum eligibility,” a statement said at the time..