A federal judge on Tuesday opened a path for the Trump administration to move forward with deporting a Venezuelan man under the Alien Enemies Act, a wartime law, but ruled that it must first give the man notice in his native language, 21 days to object and an “opportunity to be heard” in court.

The ruling, by Judge Stephanie L. Haines of the Western District of Pennsylvania, could provide a legal opening for the administration to restart deportations under the Alien Enemies Act of Venezuelans whom it considers to be members of Tren de Aragua, a gang that the White House has designated as a terrorist organization. It applies only within Haines’ district, a portion of Pennsylvania that includes Pittsburgh and the Moshannon Valley Processing Center, a privately run immigration detention facility near Philipsburg.

The decision by Haines, who was nominated by President Donald Trump during his first term, cut against recent rulings by three other federal judges — in Texas, Colorado and New York — all of whom had determined that the administration was using the Alien Enemies Act unlawfully.

Those judges found that Trump’s proclamation invoking the act improperly stretched its meaning, ruling that mass migration — even by people who may be members of Tren de Aragua — does not constitute an “invasion” or “predatory incursion,” as the act requires. Haines is the first to find that Trump’s proclamation under the act was legal.

The American Civil Liberties Union, which has taken the lead in challenging deportations under the Alien Enemies Act, said it would appeal Haines’ decision.

At the Supreme court

The U.S. Supreme Court agreed in early April to temporarily allow the administration to proceed with its use of the law, provided it gave migrants the opportunity to challenge their deportations in court. As a result, judges around the country have been considering a series of challenges from migrants potentially subject to deportation under the law, including about 10 brought by the ACLU.

One of those challenges has returned to the Supreme Court, where a ruling related to a group of Texas detainees could come anytime.

Like some of her colleagues, Haines found that the administration had not given detainees held under the Alien Enemies Act sufficient due process, as required by the Supreme Court. But her finding that Trump’s proclamation under the act was legal increases pressure on the Supreme Court to resolve issues surrounding the president’s use of the 18th-century statute.

“We disagree with the ruling and will appeal because the Alien Enemies Act is a wartime measure that cannot be used during peacetime to address migration or criminal activity,” said Lee Gelernt, a lawyer for the ACLU. “But we are pleased that the court rejected the government’s argument that they can remove people in a mere 12 hours.”

Gelernt said that “at the appropriate time,” he also planned to contest the government’s claim that his client, known by the initials A.S.R., was in fact a member of Tren de Aragua. The government has used an eight-point scale that assesses tattoos and clothing to decide who is and is not deportable under Trump’s proclamation, according to court documents.

Earlier cases

The ACLU has also brought a separate suit in U.S. District Court in Washington, seeking to protect a related group of immigrants: about 140 Venezuelan men who were sent to El Salvador under the act in March and have been there ever since in the custody of jailers at a notorious prison known as CECOT.

The judge overseeing that case, James E. Boasberg, has indicated that he probably has the authority to consider the suit even though the men are no longer on U.S. soil. At a hearing last week, Boasberg suggested that U.S. officials might have what is known as “constructive custody” over the men because the Trump administration sent them to El Salvador under a deal with the Salvadoran government.