President Donald Trump faced a major legal setback late Tuesday night after a federal appeals court rejected the White House’s use of an 18th-century law to speed up deportations of Venezuelan nationals.

In its efforts to swiftly deport Venezuelan migrants suspected of being members of international crime syndicates, the Trump administration has invoked the 1798 Alien Enemies Act, which allows for the swift deportation of citizens of a hostile nation the United States is at war with. Trump has routinely justified mass deportations that deny migrants due process under the guise of the United States being subjected to an “invasion.”

In a 2-1 decision late Tuesday night, however, the 5th U.S. Circuit Court of Appeals rejected the Trump administration’s argument, and issued an injunction prohibiting the administration from using the law as the basis for deportations.

“Our analysis leads us to grant a preliminary injunction to prevent removal because we find no invasion or predatory incursion, conclude on the current record that the updated notice satisfies due process, and remand for further proceedings,” the ruling read.

The lone judge to dissent from the majority opinion was Circuit Court Judge Andrew Oldham, who was nominated and appointed by Trump in 2018. The two judges rebuking the Trump administration’s use of the 1798 law were former President George W. Bush-appointee Judge Leslie Southwick and former President Joe Biden-appointee Irma Carrillo Ramirez.