WASHINGTON (AP) 鈥 The Supreme Court on Monday allowed the Trump administration to use an 18th century wartime law to deport Venezuelan migrants, but said they must get a court hearing before they are taken from the United States.

In a bitterly divided decision, the court said the administration must give Venezuelans who it claims are gang members 鈥渞easonable time鈥 to go to court.

But the conservative majority said the legal challenges must take place in Texas, instead of a Washington courtroom.

The court鈥檚 action appears to bar the administration from immediately resuming the flights that last month carried hundreds of migrants to a notorious prison in El Salvador. The flights came soon after President Donald Trump invoked the Alien Enemies Act for the first time since World War II to justify the deportations under a presidential proclamation calling the an invading force.

The majority said nothing about those flights, which took off without providing the hearing the justices now say is necessary.

In dissent, the three liberal justices said the administration has sought to avoid judicial review in this case and the court 鈥渘ow rewards the government for its behavior.鈥 Justice Amy Coney Barrett joined portions of the dissent.

Justice Sonia Sotomayor said it would be harder for people to challenge deportations individually, wherever they are being held, and noted that the administration has also said in another case before the court that it鈥檚 unable to return people who have been deported to the El Salvador prison by mistake.

鈥淲e, as a Nation and a court of law, should be better than this,鈥 she wrote.

The justices acted on the administration鈥檚 emergency appeal after the federal appeals court in Washington left in place an order temporarily prohibiting deportations of the migrants accused of being gang members under the rarely used Alien Enemies Act.

鈥淔or all the rhetoric of the dissents,鈥 the court wrote in an unsigned opinion, the high court order confirms 鈥渢hat the detainees subject to removal orders under the AEA are entitled to notice and an opportunity to challenge their removal."

The case has become a amid escalating tension between the White House and the federal courts. It's the second time in less than a week that a majority of conservative justices has handed Trump at least a partial victory in an emergency appeal after lower courts had blocked parts of his agenda.

Several other cases are pending, including over Trump's plan to deny citizenship to U.S.-born children of parents who are in the country illegally.

Trump praised the court for its action Monday.

"The Supreme Court has upheld the Rule of Law in our Nation by allowing a President, whoever that may be, to be able to secure our Borders, and protect our families and our Country, itself. A GREAT DAY FOR JUSTICE IN AMERICA!鈥 Trump wrote on his Truth Social site.

The original order blocking the deportations to El Salvador was issued by U.S. District Judge , the chief judge at the federal courthouse in Washington.

Attorneys from the American Civil Liberties Union filed the lawsuit on behalf of five Venezuelan noncitizens who were being held in Texas, hours after the proclamation was made public and as immigration authorities were shepherding hundreds of migrants to waiting airplanes.

ACLU attorney Lee Gelernt said the 鈥渃ritical point" of the high court鈥檚 ruling was that people must be allowed due process to challenge their removal. "That is an important victory,鈥 he said.

Boasberg imposed a temporary halt on deportations and also ordered planeloads of Venezuelan immigrants to return to the U.S. That did not happen. The judge held a last week over whether the government defied his order to turn the planes around. The administration has invoked a 鈥 鈥 and refused to give Boasberg any additional information about the deportations.

Trump and his allies have called for impeaching Boasberg. In , Chief Justice John Roberts said 鈥渋mpeachment is not an appropriate response to disagreement concerning a judicial decision.鈥

___

Associated Press writer Lindsay Whitehurst contributed to this report.

The 好色tv Press. All rights reserved.