The US Supreme Court has allowed the government to severely limit the ability of migrants to claim asylum.
The policy bars people arriving at the US southern border from seeking protection if they failed to do so in a country they passed through en route.
Legal challenges continue but the ruling means for now it can be enforced nationwide.
The plan will affect tens of thousands of Central American migrants who travel north, often on foot, through Mexico.
Mexico said on Thursday that it disagreed with the ruling.
The Trump administration unveiled the new asylum policy in July but it was almost immediately blocked from taking effect by a lower court ruling by a judge in San Francisco.
Curbing migration levels has been a key goal of Donald Trump’s presidency and forms a major part of his bid for re-election in 2020.
He hailed the Supreme Court’s decision as a major victory.
What will the changes mean?
The change will affect non-Mexican migrants trying to enter through the US southern border.
This includes, but is not limited to, those from Central American countries who have made up the vast majority of those seeking asylum so far this year.
Some 811,016 people were detained on the south-western border up until the end of August 2019, and of these, nearly 590,000 were from El Salvador, Guatemala and Honduras. The majority arrived with at least one other family member.
Many of those arriving are fleeing violence or poverty and travel north through Mexico until they reach the US border. Upon arrival, they must pass a “credible fear” interview to seek asylum in the US, which most do.
The rule change means they would fail had they not claimed asylum in another country they had first passed through.
The rule will also affect smaller numbers of African, Asian and South American migrants who arrive at the US southern border and seek asylum – many after taking extremely dangerous journeys.
The American Civil Liberties Union, which challenged the ruling, argued it drastically limited those eligible for asylum.
“The current ban would eliminate virtually all asylum at the southern border, even at ports of entry, for everyone except Mexicans,” it said in a petition.
A lawyer for the group described the ruling as a “temporary step” and said it remained confident at challenging the change.
“The lives of thousands of families are at stake,” Lee Gelerent said.
Anyone whose asylum request has been rejected by a third country or is a victim of human trafficking can still apply.
A US justice department spokesperson said the decision would help “to bring order to the crisis at the southern border, close loopholes in our immigration system and discourage frivolous claims”.
Why is this controversial?
The rule change overturns long-standing convention that the US hears asylum claims no matter how people have arrived at the border.
On the nine-judge Supreme Court, liberal-leaning Justices Ruth Bader Ginsburg and Sonia Sotomayor dissented from the ruling.
“Once again the Executive Branch has issued a rule that seeks to upend longstanding practices regarding refugees who seek shelter from persecution,” Justice Sotomayor wrote.
The route to the US is fraught with risks, with Central American migrants often deliberately sought out by gangs in neighbouring countries because they are vulnerable.
There are questions over whether Mexico and Guatemala can cope with a surge in asylum claimants.
It’s also unclear if other countries will co-operate with what amounts to a unilateral US policy.
Mexican officials, who have been working to crack down on migration, have already pushed back strongly against the plan.
Responding to the Supreme Court ruling on Thursday, Foreign Minister Marcelo Ebrard reiterated that Mexico would not become a “third country” for US-bound asylum seekers.
“It’s a US issue and obviously we don’t agree with it, we have a different policy,” he told reporters.
Earlier this week, Mark Morgan, acting commissioner of US Customs and Border Protection, said that in August 64,000 people were detained or turned back at the south-west border – down 22% from July and 56% from May.
Mr Ebrard added that he expected the number of migrants passing through Mexico to fall further.
Central American countries, with the exception of Guatemala, have also declined to sign “safe third country” agreements that would mean the US could send back asylum seekers who passed through without seeking protection.
The Guatemalan deal, signed by its outgoing president, has faced legal hurdles and is yet to come into force.
On Wednesday, Mexican President Andres Manuel Obrador posted an image of himself on the phone to President Trump, who said they had had “an excellent telephone conversation”.
The Supreme Court ruling is the second in favour of Mr Trump’s migration plans so far this year. In July the nation’s top court ruled Mr Trump could use $2.5bn (£2bn) of Pentagon funds for his long-promised southern border wall.