A federal judge said on Friday that President Donald Trump did not have the legal authority to hold immigrants at the Guantánamo Bay detention facility in Cuba before shipping them out for deportation, The New York Times reported.

U.S. District Judge Sparkle Sooknanan, an appointee of former President Joe Biden, did not immediately order the operation to be shut down, but denied the government's motion to dismiss a class-action lawsuit brought by the American Civil Liberties Union, which has vowed to seek a closure order.

"While successive administrations have for decades housed migrants at Guantánamo who have been intercepted at sea trying to reach the United States, Judge Sooknanan found that never before had the U.S. government used the base to hold people being deported from the United States," said the report. "The White House began using Guantánamo as a way station for deportees in February after an order from President Trump to prepare the base to hold up to 30,000 migrants."

So far, around 710 detainees have been held at the facility, under guard by U.S. soldiers and Marines, using a setup of tents installed for the purpose.

“The court squarely rejected the Trump administration’s legal claim that Congress gave it the extraordinary power to detain immigrants in military bases overseas,” said ACLU attorney Lee Gelernt. “We will now move promptly to end the policy based on this legal ruling.”

This comes as the Trump administration faces mounting criticism for its broader mass deportation program, from massive sweeps of cities around the country, to the summary deportation of individuals in violation of court orders.