A federal appeals court has ruled that the Trump administration cannot invoke the Alien Enemies Act of 1798 to accelerate deportations of illegal immigrants accused of being members of the Venezuelan gang Tren de Aragua.

The Fifth US Circuit Court of Appeals issued a 2-1 decision Thursday, siding with immigrant rights lawyers and rejecting the administration’s attempt to use the wartime law.

“Our analysis leads us to GRANT a preliminary injunction to prevent removal because we find no invasion or predatory incursion,” the majority said.

The administration defended its use of the statute by arguing that it had classified South and Central American gangs as terrorist organizations earlier this year, which it said justified the law. At the time, the White House said Tren de Aragua was “conducting irregular warfare and undertaking hostile actions against the United States” that included “mass illegal migration to the United States.”

In April, the Supreme Court took a case regarding the law. While it did not address the legality of the Trump administration’s use of the law, it determined that deportations can proceed for now but that individuals must be given sufficient notice prior to their removal. 

The appeals court, however, has now ruled that the administration’s claims do not reach the level of national conflict Congress intended when enacting the Alien Enemies Act. The Trump administration is likely to call on the Supreme Court to review the administration’s use of the law in full. 

“A country encouraging its residents and citizens to enter this country illegally is not the modern-day equivalent of sending an armed, organized force to occupy, to disrupt, or to otherwise harm the United States,” the majority justices wrote.

The ruling blocks deportations under this specific law in Texas, Louisiana, and Mississippi.

“The Trump administration’s use of a wartime statute during peacetime to regulate immigration was rightly shut down by the court,” Lee Gelernt, who represented the American Civil Liberties Union, said, according to Fox News. “This is a critically important decision reining in the administration’s view that it can simply declare an emergency without any oversight by the courts.”