SANTA ANA, Calif. (CN) — A federal judge ruled Thursday that Vietnamese refugees here a quarter century or more but who have lately been taken into custody by immigration authorities — despite not being eligible to be deported — may continue their national class action challenging their detentions.

The refugees claim that the Trump administration is backing away from a 10-year-old diplomatic agreement with Vietnam not to deport anyone who came here prior to July 12, 1995, when the two countries normalized relations.

U.S. District Judge Cormac Carney ruled that the plaintiffs in the class action have presented a plausible claim that the government is now not abiding by a “longstanding practice of not removing pre-1995 Vietnamese immigrants and [by] the 2008 diplomatic agreement.”

“This is a great win for the petitioners,” said Tuan Uong, a senior associate at Reed Smith in Los Angeles, who is one of the lead attorneys in the case. “At the end of the day, Judge Carney recognized that there is a serious due process violation in play.”

The plaintiffs in the class action all came to the U.S. before the 1995 date and became legal permanent residents. However, because of criminal convictions, they all lost their green cards, making them subject to deportation.

Under the formal diplomatic agreement, Vietnam may refuse to accept the return of any pre-1995 refugees. In line with a 2001 U.S. Supreme Court decision restricting overlong detention, the federal government generally kept such immigrants in custody no more than 90 days and then released them under supervision.

But the Trump administration is trying to change that policy, according to the class action.

Beginning in March 2017, Immigration and Customs Enforcement officers began rounding up dozens of pre-1995 Vietnamese immigrants and putting them in months-long detention, even though returning them to Vietnam was a remote possibility, the plaintiffs say.

“The government wants to detain these folks indefinitely,” Uong said. “I think what the government is trying to do is circumvent the [diplomatic] agreement.”

Two attorneys with the Department of Justice’s Office of Immigration Litigation who are handling the case did not return phone messages Thursday afternoon. The Justice Department press office did not respond to an email about the case.

The lawsuit seeks to release refugees in custody. It was filed Feb. 22 by the Asian Americans Advancing Justice’s Asian Law Caucus in San Francisco and by the group’s Los Angeles and Atlanta branches in the name of Orange County resident Hoang Trinh and six other refugees who had been detained.

The named defendants include Thomas Homan, the head of ICE’s Enforcement and Removal Operations, Homeland Security Secretary Kirstjen Nielsen and U.S. Attorney General Jeff Sessions.

Trinh had been detained by ICE from June 2017 to April 2018, following a jail sentence on a drug charge, according to Carney’s ruling. He came to the U.S. in 1980 as a child and obtained his green card. Trinh’s “wife, two children, parents, and six sisters are all U.S. citizens.”

Another named plaintiff, Long Nguyen of Charleston, S.C., immigrated in 1987 and became a legal resident the next year. He was convicted of a nonviolent drug offense in 2006 but detained in 2010 or 2011 while abroad. He was released when Vietnam refused to take him back.

Then, in October last year, he was pulled over while driving to work and put in detention until March this year, according to the judge.

When the class action was filed, advocates said they knew of about 40 refugees in long-term custody, but they added they believed 8,000 to 10,000 more were at risk.

In his decision, Carney first rejected the government’s argument that the suit was moot because all seven named petitioners had been released.

On the main issue, the refugees argued that their prolonged detention violates immigration law and their due process rights because, under the 2008 agreement, it is highly unlikely that they can be returned to Vietnam.

The defendants countered that relations between the U.S. and Vietnam are changing. Other agreements between the two countries indicate that deportation “is no longer unlikely in the foreseeable future,” according to the defense.

Carney rejected that argument because he said it relied on documents not part of the formal pleadings in the case.

He also allowed the class plaintiffs to continue their claim that they each should have been given an individual bond hearing before being detained.

Carney is scheduled to hear arguments on certifying the refugee class on Oct. 15.

Last month, he certified a class of Cambodian refugees raising somewhat similar due process claims.