The Biden administration can terminate a controversial Trump-era policy that required asylum seekers to wait in Mexico while claims are processed, the Supreme Court has ruled.
President Joe Biden had called the programme "inhumane" and tried to end it on his first day in office.
His efforts, however, were blocked by a federal judge.
Two Republican-led states argued that the policy helped control the border.
In a 5-4 decision, the conservative-majority court sided with Biden against Texas and Missouri, ruling that the Biden administration didn't violate proper administrative procedure in rescinding the policy, formerly known as the Migrant Protection Protocols, or MPP.
In an opinion for the majority, Justice John Roberts wrote that the administration's repeal of the policy "did not violate" immigration law.
Additionally, the court found that lower courts do not have the power to tell the government what tools or methods it can use to control immigration - essentially giving the president broad power to set US immigration policy.
During the Trump administration, about 70,000 asylum seekers were returned to Mexico to wait for their hearings. They were often left there for months and sometimes were preyed upon by criminal gangs.
Human Rights First, a charity organisation, says that more than 1,500 migrants have been reported kidnapped, raped, or abused after being returned to Mexico.
Mr Biden moved to end the process on his first day in office as part of a wider effort to reverse the Trump administration's immigration policies.
Several months after a federal judge ordered the resumption of the policy, the Biden administration restarted it in December 2021.
Ahead of Thursday's decision, activists warned that a failure to end the policy would have had disastrous consequences for thousands of migrants.
Natalia Trotter, an attorney working with the Refugee and Immigrant Center for Education and Legal Services (Raices) in Texas, told the BBC that the policy "violates US and international asylum law" and puts migrants into "deadly and terrifying conditions".
The repeal of the policy - along with Title-42, another Trump-era initiative still in place that allows migrants to be expelled quickly to prevent the spread of Covid-19 - is "imperative" to allow migrants "exercise their legal right to seek protection in the US", said Ms Trotter.
Immigration activist and former Border Patrol officer Jenn Budd said that a repeal of the policy would be "enable safety" for migrants and end the "chaos, crimes, murders, ransoms and kidnappings" that have occurred as a result.
"[It would be] a return to a normal process of asylum, as it is throughout the world," Ms Budd added. "That's also the normal asylum process in the US. We're just not following our laws."
US officials say they are on pace to exceed two million migrant "encounters" in the fiscal year that began in October, the fastest pace in more than 20 years.
A win for President Biden
After a string of devastating legal decisions for Democrats in recent weeks, their side ended this Supreme Court term with a win. President Joe Biden not only has the power to end Donald Trump's "remain in Mexico" policy, his administration followed the proper legal procedures to do so.
That's no small thing, as the Supreme Court had derailed several major initiatives during Donald Trump's presidency - such as his rollback of Barack Obama's immigration policies and attempt to include a citizenship question on the national census - on just such procedural grounds.
Of course, Mr Biden's win here will set off a new round of headaches for his administration, which has grappled with surging undocumented migration at the US-Mexico border.
Those on the left will celebrate the ruling, and call on the Biden administration to take further steps to terminate his predecessor's immigration policies. Meanwhile, the administration's immigration critics - including some within his own party - will warn that allowing asylum seekers to stay in the US while their claims are processed will only encourage more migration.
Mr Biden now has the freedom to act - but he also won't have the courts to blame if things go wrong.