A federal judge has sided with seven immigrants in Santa Ana who said the Trump administration violated their constitutional rights when it suspended an alert system that read their immigration status from their city jail.

U.S. District Judge John Walter on Friday also ordered the release of nearly $125,000 in attorney fees the immigrants received as part of their class-action lawsuit challenging the administration's decision to block the virtual notification service used by city jails in at least eight cities nationwide.

Filed in July, the lawsuit alleged that Homeland Security Secretary Kirstjen Nielsen and other U.S. officials violated constitutional rights by failing to give advance notice of changes to policies that affected the detainees.

In addition to Santa Ana, which had a kiosk that notified the city jails' inmates of their immigration status, the lawsuit argued that the federal government violated inmates' rights when officials cut off the notifications in counties and cities that are parts of the Border Patrol's sector in Texas.

Walter ruled that cities and counties that conduct detainer notifications can no longer deny the constitutional right to access to the information. He also ordered the reunification of those affected with their attorneys.

As the Santa Ana inmate population has shrunk, the inmate kiosk is no longer required.

Walter concluded that the government "exercised its discretion and did not arbitrarily block access to the electronic notification."

The judge said he was applying current immigration law and that it was up to local officials to follow U.S. laws.

"Some elected officials may have preferred that ICE detain inmates long after their sentence has ended, but Congress has protected them from that choice. When the federal government engages in no substantial revisions to these regulations, law-abiding local officials have no choice but to carry out the orders of the federal government," he wrote.

In a press release, the American Civil Liberties Union of Southern California had said Thursday's hearing was an important step toward protecting immigrant communities.

ACLU Staff Attorney Jim Wong said: "In Santa Ana, ICE agents were interacting routinely with law enforcement officers, prosecutors, and corrections officers. The plan was to have one place that not only gave detainees up-to-date information on their release date, but an individualized notification from jail to family members and friends so they could prepare for a release."

Followers of the case had been treated like "lab rats," he said.

U.S. officials argued that no constitutional rights had been violated because only the people identified in the jails' electronic notices were receiving them.

As for the federal government's switch to using referrals from jails instead of handouts, which allow government officials to communicate to individuals directly about their status, the judge sided with the prisoners.

"This switch was arbitrary and capricious because even the federal government admits that it cannot advise individuals one-on-one about their immigration status," Walter wrote.

Follow for national news.