A federal judge in Pennsylvania ruled on Tuesday that the United States can use the Alien Enemies Act to fast-track the deportation of accused Venezuelan gang members, in what appears to be the first court ruling that backs the Trump administration’s interpretation of the 1798 law.

Haines, appointed by Trump during his first term, ruled that the administration must give potential deportees at least 21 days’ notice and the opportunity to challenge their removals, to avoid the possibility that people who are not gang members “may be errantly removed from this country.”

Judge Stephanie Haines, of the U.S. District for the Western District of Pennsylvania, ruled that President Donald Trump has authority to declare the Venezuelan gang Tren de Aragua a foreign terrorist organization and deport its members under the Alien Enemies Act, but she criticized the administration’s practice of deporting people sometimes “within a matter of hours.”