Asylum-seeking migrants from Mexico and Central America queue to receive food rations at an encampment at El Chaparral border crossing in Tijuana in March. REUTERS/Jorge Duenes

A federal judge in Texas has ordered President Joe Biden’s administration to reinstate his Republican predecessor’s “remain in Mexico” policy, which forced tens of thousands of Central American asylum-seekers to wait in Mexico for U.S. court cases.

In a victory for the states of Missouri and Texas, which brought the suit, U.S. District Court Judge Matthew Kacsmaryk said on Friday that the Biden administration had violated laws on procedure by failing to consider “several of the main benefits” of the program and acted “arbitrarily and capriciously” in ending it.

A Biden administration memo announcing a formal end to the policy was circulated June 1. It was not clear how the ruling would ultimately impact that decision. Former President Donald Trump instituted the policy in early 2019.

Kacsmaryk, a Trump appointee, stayed his decision for a week to allow the Biden administration to appeal. The Department of Homeland Security did not immediately respond to a request for comment.

Trump’s “remain in Mexico” policy sought to block asylum seekers from Central America by making them wait in Mexico for the outcome of their U.S. asylum hearings.

Defenders of the policy said it reduced pressure on overburdened immigration officials; human rights groups said it violated due process and exposed destitute refugees to the risk of kidnap, abuse and rape.