(CNN) The Supreme Court on Thursday gave President Joe Biden the green light to end the controversial "Remain in Mexico" immigration policy that originated under the Trump administration.
Since the beginning of his administration, Biden has tried to wind down the policy, which sends certain non-Mexican citizens who entered the US back to Mexico -- instead of detaining them or releasing them into the United States -- while their immigration proceedings played out.
The ruling was 5-4, and states that immigration law gives the federal government the discretion to end the program, formally known as Migrant Protection Protocols. The case will go back down to lower courts for additional proceedings around his latest attempt to end the program. A hold on Biden's bid to end the program remains in place, but Thursday's ruling suggested that that order should be lifted shortly.
Writing for the majority, Chief Justice John Roberts said that the relevant immigration statute "plainly confers a discretionary authority to return aliens to Mexico during the pendency of their immigration proceedings."
"The use of the word 'may" in" the law question, Roberts wrote, "makes clear that contiguous-territory return is a tool that the (DHS) Secretary 'has the authority, but not the duty,' to use."
The Supreme Court's decision is a major victory for the Biden immigration agenda as the administration has suffered several losses in lower courts in its efforts to reverse Trump's hardline immigration policies. Several of the red states that challenged the termination of Migrant Protection Protocols have also brought lawsuits challenging other attempts by Biden to pivot away from his predecessor's aggressive approach and those cases are still working their way through lower courts.
The Department of Homeland Security applauded the ruling.
"As Secretary Mayorkas concluded in October 2021 after a thorough review, the prior Administration's Migrant Protection Protocols (MPP) has endemic flaws, imposes unjustifiable human costs, and pulls resources and personnel away from other priority efforts to secure our border," a statement from the department read. "We welcome the Supreme Court's decision affirming that the Secretary has the discretionary authority to terminate the program, and we will continue our efforts to terminate the program as soon as legally permissible."
Roberts was joined by the liberal justices and Justice Brett Kavanaugh, with Kavanaugh also filing a concurring opinion. Justices Samuel Alito and Amy Coney Barrett wrote dissenting opinions, joined by the other dissenters.
With its ruling, the court said that lower courts must now consider whether the government complied with administrative law with the more recent attempt that the Biden administration made -- with a memo rolled out in October -- to end the Trump-era policy.
Biden's bid to terminate the program had been challenged in court by a coalition of red states led by Texas that argued that ending it ran afoul of immigration law. They also argued that administration violated the Administrative Procedure Act -- which requires that agencies take certain procedural steps when implementing policy -- in how it went about unwinding Migrant Protection Protocols.
The lower courts, which refused to consider the October memo, will now examine whether that latest attempt to end the program complied with the Administrative Procedure Act.
Roberts wrote that the government's authority to release some migrants on parole, rather than detain them or send them back to Mexico, is not "unbounded," while noting immigration law's requirement that parole be used "on a case-by-case basis."
"And under the APA, (the Department of Homeland Security's) exercise of discretion within that statutory framework must be reasonable and reasonably explained," Roberts said.
His opinion also said that the lower court erred in blocking Biden's termination of the program, citing Thursday a court ruling from earlier this term that said lower courts could not grant class-wide orders that barred immigration officials from carrying out certain policies.
That suggests that lower courts, in the next round of litigation over "Remain in Mexico," will not have the authority to block Biden's bid to end the program, but it was not immediately clear whether the administration can end the policy immediately.
The justices' holding on lower court authority may also hamstring future efforts to challenge in court the immigration policies of Democratic and Republican administrations -- meaning that immigrant rights activists may have secured a short-term victory with Thursday's ruling while suffering a longer-term setback.
"While we are heartened that today's decision will end the cruel and inhumane Remain in Mexico program, stripping federal courts of their ability to issue injunctions in immigration enforcement and detention cases not brought by individual immigrants will have severe ramifications on immigrant rights going forward," Aaron Reichlin-Melnick, policy director of the American Immigration Council, said in a statement. "Limiting access to justice to challenge immigration enforcement cases sets a dangerous precedent by giving agencies unchecked power to arrest, detain, and deport."
The program, which was first implemented in 2019 under then-President Donald Trump, has been criticized by immigrant-rights advocates, who argue that it's inhumane and that it exposes asylum seekers with credible claims to dangerous and squalid conditions in Mexico.
Before the Trump administration put the "Remain in Mexico" program in place, no other administration had embraced such an approach toward non-Mexican asylum-seekers that required them to stay in Mexico over the course of their immigration court proceedings in the United States. Biden campaigned on ending the policy and has said it "goes against everything we stand for as a nation of immigrants."
Biden has grappled with a growing number of border crossings over the course of his administration amid mass migration in the Western hemisphere. Since October, border authorities have encountered migrants more than a million times along the US-Mexico border, though many have been turned away under a separate pandemic-emergency rule. The Department of Homeland Security, though, has maintained that the "Remain in Mexico" policy comes at a steep human cost and is not an effective use of resources.
Immigrant rights advocates celebrated Thursday's ruling. Taylor Levy, an immigration attorney who worked on hundreds of MPP cases, said in a statement that the decision was a "victory for tens of thousands of people who were stranded by Remain in Mexico and subjected to unimaginable cruelty."
Judy Rabinovitz, special counsel with the ACLU's Immigrants' Rights Project, said in the statement that, with the case returning to lower court, the Biden administration " can and should move forward swiftly to finally terminate 'remain in Mexico' for good -- a result that has been long, and unjustly, delayed."
According to the Biden Justice Department, the relevant immigration law had never before been interpreted as requiring the government to send migrants back to Mexico with pending immigration proceedings that it was unable to hold in detention.
"Every presidential administration has understood this to just be a purely discretionary authority. That goes for the prior administration," Solicitor General Elizabeth Prelogar said at oral arguments in April.
She also argued that keeping "Remain in Mexico" in force would not solve the essential problem: that Congress has instructed that immigration officials "shall" detain asylum seekers whose proceedings are pending but that lawmakers have failed to appropriate sufficient resources for those detention facilities.
"Contiguous territory return cannot be the solution here," Prelogar said, while noting that when the Trump administration was carrying out the policy, only 6.5% of the migrants encountered at the border were enrolled in the program.
"It has inherent constraints," Prelogar said, pointing to the buy-in the program requires of Mexico, a sovereign nation.
In his concurrence, Kavanaugh decried the "multi-decade inability of the political branches to provide DHS with sufficient facilities to detain noncitizens who seek to enter the United States pending their immigration proceedings."
In a dissent joined by Justices Clarence Thomas and Neil Gorsuch, Alito wrote that the government has sought to "release into this country untold numbers of aliens who are very likely to be removed if they show up for their removal hearings."
"This practice violates the clear terms of the law, but the Court looks the other way," he wrote.
Justice Amy Coney Barrett, joined in part by the other three dissenters, wrote a dissenting opinion that said she did not believe that lower courts had the authority to reach the underlying legal questions in the case.
Biden first sought to suspend the program on the day he took office in 2021, prompting the red states' lawsuit. That June, DHS Secretary Alejandro Mayorkas issued a memo formally ending the policy -- but a federal judge in Texas blocked that move in August. The Supreme Court days later refused to put that ruling on hold while the appeal played out, effectively requiring Biden to revive "Remain in Mexico."
In October, Mayorkas issued a new memo ordering the program's termination, which sought to address the procedural flaws laid out in the district court's August ruling. A point of contention in the lower court proceedings was whether that October memo made the earlier rulings moot, with the 5th US Circuit Court of Appeals finding that it did not.
The policy restarted last December. More than 5,000 migrants have been returned to Mexico under the program since then, according to the International Organization for Migration. Nicaragua, Cuba, Colombia, and Venezuela are among the nationalities enrolled in the program.
The most sweeping issue in the case was the level of discretion left to the executive branch by immigration statutes in question, which were amended on several occasions over the last century-plus. One provision of the law says that asylum seekers whose claims are still being vetted "shall" be detained pending those proceedings.
Another provision, adopted in 1996, said the federal government "may return" migrants still awaiting their proceedings to the contiguous territory from which they entered. Another provision says that, on a "case by case" basis, immigration officials may release on parole migrants whose proceedings are pending.
The Biden administration's opponents in the case had argued that the administration had been releasing migrants on parole in a categorical way that went beyond the "case by case" basis outlined in the statute.
"Petitioners would prefer not to choose from the options Congress has provided—namely, to detain, individually parole, or return covered aliens," Texas said in a brief. "They instead seek the power to release classes of aliens into the United States en masse."
This story has been updated with additional information.