The legal scramble comes as the Trump administration is pushing forward with plans to carry out mass deportations, including efforts to send migrants to a country where they are not a citizen. The most controversial example of so-called third-country removals has been sending Venezuelans to a notorious El Salvador prison.

Sending deportees to Libya, a country with a documented history of migrant abuse, would mark a major escalation of the administration’s push for third countries to take in people being removed from the United States.

A U.S. official said earlier Wednesday there were plans to fly migrants to Libya on a military plane but did not have details on the timing of the C-17 flight. The official spoke on condition of anonymity to discuss military operations.