(Bloomberg) -- A federal judge ordered the Biden administration to revive a controversial policy begun under former President Donald Trump that forces immigrants seeking U.S. asylum at the southern border to wait in Mexico while their applications are pending.

U.S. District Judge Matthew J. Kacsmaryk in Amarillo, Texas, ruled Friday that the Biden administration “failed to consider several critical factors, including the benefits of the remain in Mexico policy,” before ending the program.

It’s another setback for President Joe Biden following a January ruling by a different judge in Texas that temporarily blocked the new administration’s plan to pause deportations of undocumented immigrants for 100 days.

Friday’s decision came in a lawsuit filed by the Republican-led states of Texas and Missouri, which claimed the suspension of the program was worsening conditions at the border and allowing criminals to slip into the country.

Biden suspended the so-called Remain in Mexico program the day after he office on Jan. 20., on the grounds that it pushed migrants into squalid and dangerous housing south of the border,

After a review, Homeland Security Secretary Alejandro Mayorkas announced the end of the program on June 1. He said he determined that it “does not adequately or sustainably enhance border management in such a way as to justify the program’s extensive operational burdens and other shortfalls.”

In his 53-page ruling, Matthew J. Kacsmaryk said that Mayorkas had failed “to show a reasoned decision” for ending the program. The judge, who was appointed by Trump, also faulted the Biden appointee for not addressing “the problems created by false claims of asylum” or considering that many asylum seekers are “found non-meritorious by federal immigration judges.”

©2021 Bloomberg L.P.