The Trump administration denied Sunday that it had violated a court order by deporting hundreds of Venezuelan immigrants to a prison in El Salvador over the weekend, saying that the president had broad powers to quickly expel them under an 18th-century law meant for wartime.

White House press secretary Karoline Leavitt also asserted in a statement that the federal courts “have no jurisdiction” over the president’s conduct of foreign affairs or his power to expel foreign enemies.

“A single judge in a single city cannot direct the movements of an aircraft carrier full of foreign alien terrorists who were physically expelled from U.S. soil,” she said in a statement. It was unclear why she referred to an aircraft carrier, because all indications were that the Venezuelans had been flown to El Salvador.

While White House officials exulted over what they see as a precedent-setting victory in their efforts to speed up deportations, the comments also tacitly acknowledge that the court battles over their legal rationale may be just beginning.

President Donald Trump signed an executive order Friday invoking the Alien Enemies Act of 1798 to rapidly arrest and deport those the administration identifies as members of the Tren de Aragua gang without many of the legal processes common in immigration cases. The enemies law allows for summary deportations of people from countries at war with the United States.

On Saturday, Judge James Boasberg of U.S. District Court in Washington issued a temporary restraining order blocking the government from deporting any immigrants under the law after Trump’s order invoking it.

In a hastily scheduled hearing sought by the American Civil Liberties Union, the judge said he did not believe that federal law allowed the president’s action. He also ordered that any flights that had departed with Venezuelan immigrants under the executive order return to the United States “however that’s accomplished — whether turning around the plane or not.”

“This is something you need to make sure is complied with immediately,” he said.

Officials have not said when the deportation flights landed in El Salvador, but Leavitt insisted Sunday that the migrants “had already been removed from U.S. territory” at the time of the judge’s order. She did not say whether the planes could have, as the judge ordered, turned around and returned to the United States.

El Salvador’s president, Nayib Bukele, posted a three-minute video on social media of men in handcuffs being led off a plane during the night and marched into prison. The video also shows prison officials shaving the prisoners’ heads.

The Trump administration hopes that the unusual prisoner transfer deal — not a swap but an agreement for El Salvador to take those suspected of being gang members — will be the beginning of a larger effort to use the Alien Enemies Act.

That law, best known for its role in the internment of Japanese Americans during World War II, has been invoked three times in U.S. history — during the War of 1812 and both World Wars — according to the Brennan Center for Justice, a law and policy organization. U.S. officials familiar with the deal said that the United States would pay El Salvador about $6 million to house the prisoners.

During the hearing Saturday, Boasberg said he was ordering the government to turn flights around given “information, unrebutted by the government, that flights are actively departing.”

A lawyer representing the government, Drew Ensign, told Boasberg that he did not have many details to share, and that describing operational details would raise “national security issues.”

The timing of the flights to El Salvador is important because Boasberg issued his order shortly before 7 p.m. in Washington, but video posted from El Salvador shows the deportees disembarking the plane at night. El Salvador is two time zones behind Washington, which raises questions about whether the Trump administration had ignored an explicit court order.

Boasberg’s order to turn flights around came after he told the government earlier Saturday not to deport five Venezuelan men who were the initial focus of the legal fight. The Trump administration is appealing the judge’s order.

In a court filing, the Trump administration said the departments of State and Homeland Security were “promptly notified” of the judge’s written order when it was posted to the electronic docket at 7:26 p.m. Saturday.

The administration said that the five plaintiffs who filed suit to block their deportations — the suit that yielded the judge’s first order Saturday — had not been deported.

The filing added that “some gang members subject to removal” by the president’s decree “had already been removed” from U.S. territory before Boasberg issued the second, broader order.

On Sunday, Bukele posted a screenshot on social media about Boasberg’s order and wrote, “Oopsie... Too late.” Secretary of State Marco Rubio later shared Bukele’s post from his personal account.

On Sunday, the Venezuelan government denounced the transfer, saying that it flew in the face of U.S. and international laws and adding that the attempt to apply the Alien Enemies Act “constitutes a crime against humanity.”

The statement compared the transfer with “the darkest episodes of human history,” including slavery and Nazi concentration camps. In particular, Venezuela denounced what it called a threat to kidnap minors as young as 14 by labeling them as terrorists, claiming that the minors were “considered criminals simply for being Venezuelan.”

The government of Venezuela’s president, Nicolás Maduro, has presented an obstacle to the Trump administration as it plans to step up deportations — and to target people suspected of being Tren de Aragua members — because for years it has not regularly accepted deportation flights. In recent weeks, Maduro has gone back and forth on whether his government would accept such flights with Venezuelans from United States.

As a result, the Trump administration has sought alternative destinations, including the naval base at Guantánamo Bay, Cuba, where it has sent some migrants, including those suspected of being gang members, though it has since removed them from the base.

In an unusual turn, El Salvador has presented Trump with another alternative.