The Trump administration moved swiftly on Thursday to halt several planned deportations to third countries following a ruling by the U.S. Court of Appeals for the First Circuit. The court’s decision, issued late Wednesday, requires that migrants facing deportation to a third country be given “a meaningful opportunity” to present evidence that they fear persecution or harm in that country, a process the government had previously bypassed.

Until this ruling, the administration relied on diplomatic assurances from receiving countries that deportees would not face persecution or torture, allowing it to forgo individual fear screenings and expedite removals. The program was used as a means to deport immigrants who could not be sent directly back to their countries of origin due to various legal barriers. According to James Percival, the Department of Homeland Security’s chief counsel, more than 25,000 people have been deported under this policy.

The program has faced criticism for sending migrants to countries with questionable human rights records. Some reports have highlighted abuses, including incidents in Equatorial Guinea where detainees deported from the United States were reportedly subjected to mistreatment by local authorities.

Following the First Circuit’s decision, Homeland Security officials acted to prevent deportees from boarding flights destined for countries such as Costa Rica, Honduras, and the Central African Republic, according to internal documents. The ruling imposes a new procedural requirement, complicating the government’s efforts to rapidly expel migrants without giving their legal representatives the chance to contest the deportations.

The Department of Homeland Security described the court ruling as “reckless” and “lawless,” emphasizing the administration’s position that third-country removals are essential for public safety and the removal of dangerous criminal aliens from U.S. communities.

In response to the ruling, the administration filed an emergency application with the U.S. Supreme Court Thursday, seeking to reinstate the deportation program. Solicitor General D. John Sauer characterized the program as “an essential tool to remove certain aliens, including some of the worst criminal aliens.” Justice Ketanji Brown Jackson has ordered challengers to respond to the emergency application by Monday.

Attorney General Todd Blanche also expressed confidence that the government would prevail in ongoing legal challenges. He criticized the appellate court for issuing the decision “in the dark of night” and affirmed the administration’s commitment to quickly seek relief from the Supreme Court, noting that the high court had previously granted a stay in the same case.

The outcome of these legal proceedings will determine whether the administration can continue to rely on diplomatic assurances to carry out deportations to third countries without providing individual migrants the chance to contest their removal.