After more than five years, a civil rights group’s battle to ensure mentally disabled immigrants the right to legal representation is over.

Now, hundreds of those immigrants who were previously ordered deported will have the chance to return to the United States to contest their expulsion, US District Judge Dolly M. Gee ruled on Friday.

Immigrants with “serious mental disabilities” deported from California, Arizona, and Washington between Nov. 21, 2011 and Jan. 27, 2015, can now request to have their cases reopened, according to the Associated Press.

So far, the government has identified 900 people eligible to return. Many of them are from Latin America or Asia, an attorney for the American Civil Liberties Union (ACLU), which helped file the class action lawsuit, told Reuters.

“It was a huge victory, truly a landmark ruling, and we're very happy that our class members were no longer going to be forced to stand alone in court," said Carmen Iguina.

Hector Villagra, executive director of Southern California’s ACLU, called the ruling “a victory for due process.”

The settlement comes after an April 2013 injunction, also issued by Judge Gee, ordered that immigrants with serious mental disabilities have a right to legal representation if they are proven unable to represent themselves.

Evaluations to determine immigrants’ mental competencies then became mandatory in October 2014, although it was not until January 2015 that these started – forcing detainees to represent themselves.

Jose Antonio Franco-Gonzalez, for instance – whose case was central to the lawsuit – was a Mexican citizen with “the cognitive ability of a two-year-old,” wrote Southern Illinois University law professor Cindy Buys in The Globe law journal.

Despite “a 2005 psychiatric diagnosis of moderate mental retardation … and an inability to understand the immigration proceedings, Jose was held in immigration detention for another five years before being released,” wrote Professor Buys. “The US government expected Mr. Franco-Gonzalez and others like him to defend themselves in immigration proceedings.”

This ruling now signifies a step toward resolving the status of those hundreds who were deported without a screening before these requirements came, according to Patch.

Reuters reports that an unspecified number of those who were ordered deported have stayed in the country waiting to appeal.

Litigation has also been underway to give other “particularly vulnerable groups,” such as minors and asylum seekers, the right to legal representation, writes Buys.

“The victory represents the first time any court has ruled that a class of non-citizens are entitled to legal representation,” said the ACLU.

This report contains material from The Associated Press.