Migrants wait outside a shelter in San Antonio, Texas on June 29, 2022. AFP
Under the policy, some non-Mexicans who entered the United States illegally across the southern border were sent back to Mexico to wait while their immigration cases played out in court, rather than being detained or provisionally released.
Since the beginning of his term, Biden has been trying to wind down the policy as part of what he claims is a more humane take on immigration.
Advocates for migrants said the policy exposed asylum-seekers to dangerous conditions in Mexico as overwhelmed US courts slowly work through a backlog of cases.
Thursday's ruling in favor of the Biden administration was split 5-4, with Chief Justice John Roberts joining fellow conservative Brett Kavanaugh and the court's three liberal justices in the majority.
Roberts, who authored the majority opinion, argued that federal immigration law allows the executive branch to return asylum seekers to Mexico, but does not force it to do so.
"Congress conferred contiguous-territory return authority in expressly discretionary terms," the opinion states.
Biden's attempt to terminate the policy, instituted by Trump in 2019, was challenged by a group of Republican-governed states led by Texas.
These states argued that his move violated US immigration law by forcing authorities to release migrants they had detained onto US territory. They also said that Biden officials had not followed proper administrative procedure.
A lower court in August 2021 ruled against the Biden administration and the case eventually ended up before the nation's highest court.
At first, the Supreme Court simply refused to freeze the lower court ruling, forcing the administration to restart the policy, formally called Migration Protection Protocols (MPP), while it pressed ahead with its appeal.
From the start of the policy in January 2019 until its suspension under Biden, nearly 70,000 people were sent back to Mexico, according to the American Immigration Council.
Since its most recent reinstatement, far fewer migrants have been sent back through the program.
During Biden's tenure as president, more than 200,000 people attempting to enter the country illegally have been interdicted at the border each month and sent back, under MPP or a separate Covid-related policy blocking people at the border.
Illegal border crossings are often dangerous, both for the physical conditions in the region and mistreatment by human traffickers. This week 53 people died after being packed inside a tractor trailer truck without air conditioning that was later abandoned in San Antonio, Texas.
The American Civil Liberties Union praised the court's ruling on Thursday.
"The Supreme Court was right to reject the spurious argument that this cruel policy is statutorily required," said Judy Rabinovitz of the ACLU Immigrants' Rights Project.