The court said that the Biden Administration failed to show that its June memorandum repealing the policy wasn’t “arbitrary and capricious.” The court’s three liberal justices dissented.

The court’s ruling ends the Biden administration’s attempt to avoid a federal district court ruling issued last Friday which required the president to continue enforcing Trump’s policy. On that same day, the Biden administration filed an emergency request with the Supreme Court. The filing noted the court’s history of staying “broad lower-court injunctions against Executive Branch policies addressing matters of immigration.”

In response to the Supreme Court’s ruling, the U.S. Department of Homeland Security (DHS) issued a statement saying that it “regrets” the court’s decision.

“DHS has appealed the district court’s order and will continue to vigorously challenge it,” the DHS statement said. “As the appeal process continues, however, DHS will comply with the order in good faith.”

The DHS also said it has begun diplomatic discussions with the Mexican Government to create new ways to deal with the Trump-era policy.

The “remain in Mexico” policy, instated by Trump on January 25, 2019, requires immigrants and asylum seekers to remain in Mexico while awaiting their immigration court proceedings in the United States. It was implemented as part of Trump’s Migration Protection Protocols (MPP) program and followed through with his administration’s aim of reducing the number of immigrants within the United States.

Under Biden, the Department of Homeland Security sought to repeal the policy with a June 1 memorandum. The memo, written by U.S. Secretary of Homeland Security Alejandro Mayorkas, said the policy “does not adequately or sustainably enhance border management in such a way as to justify the program’s extensive operational burdens and other shortfalls.”

However, the states of Texas and Missouri quickly filed a lawsuit for an injunction against the memo’s attempted repeal.

Last Friday, the U.S. District Court for the Northern District of Texas placed an injunction against the Biden Administration’s repeal. The injunction required anyone acting under the administration’s command to continue complying with the Trump-era policy.

The federal court’s ruling also required the Biden administration to file a monthly report with the court. The report must state the total number of encounters with undocumented immigrants at the southern U.S. border and the number of immigrants expelled under the “remain in Mexico” policy. The report must also state the total capacity and usage rate of immigrant detention facilities in the U.S. as well as the total monthly number of asylum-seeking applicants seeking to circumvent the policy, court documents said.

Additionally, the court’s ruling also required the Biden administration to file a monthly report with the court. The report must state the total number of encounters with undocumented immigrants at the southern U.S. border and the number of immigrants expelled under the “remain in Mexico” policy. The report must also state the total capacity and usage rate of immigrant detention facilities in the U.S. as well as the total monthly number of asylum-seeking applicants seeking to circumvent the policy, court documents said.

Despite the court’s ruling, the “remain in Mexico” policy doesn’t affect every undocumented immigrant who arrives at the southern border, according to Justice for Immigrants, a U.S. Catholic immigration reform organization.

Unaccompanied children aren’t subject to it nor are violent offenders and other known criminals who should be in jail with the U.S. or Mexico. The policy also doesn’t apply to migrants with known mental or medical health issues or those who are determined by the Department of Homeland Security as likely to face persecution or torture if left within Mexico.

However, migrants awaiting their trials in Mexican border towns live in “inhumane” conditions and are “preyed upon by criminal organizations,” a spokesman for Doctors Without Borders told Border Report on March 9.

Waiting migrants are often cut off from all hometown family, legal or social supports. They don’t always have viable options for stable shelter, food, money, medical care or other social support either. Drug cartel operatives can recruit or kidnap migrants, holding them for ransom and murdering them if their families don’t comply with their financial or criminal demands.

Newsweek contacted the White House for comment.

Update (8/24/2021, 9:53 p.m.): This article has been updated to include a statement from the DHS.