BOSTON (Reuters) - U.S. immigration authorities violated the rights of two Brazilian illegal immigrants arrested after they went to government offices to be interviewed as part of a process to seek legal status, a federal judge ruled on Tuesday.

U.S. Immigration and Customs Enforcement agreed to release one of the immigrants, a mother who had been separated from her 11-year-old son since her arrest over four months ago, following the ruling by U.S. District Judge Mark Wolf in Boston.

The woman, Lucimar de Souza, is among a group of people pursuing a class action lawsuit contending that President Donald Trump’s administration is improperly detaining illegal immigrants who are married to U.S. citizens and are seeking to live in the country legally.

The Republican president has taken a hardline stance on immigration, both legal and illegal, since taking office in January 2017.

The judge said ICE failed to meet deadlines requiring it to give de Souza and another Brazilian who, like her, was in custody for over 90 days, notice so they could prepare documents for a custody review process.

“The unlawfully short notice basically prevented her from presenting evidence in support of her request for release,” Wolf said in court.

ICE did not respond to a request for comment.

Citing other cases, Wolf said he was concerned other detained immigrants’ rights are also being violated.

He called ICE “untrustworthy” and scheduled a hearing for March 15 where immigration officials would be required to testify about the series of events that led to the detentions of de Souza and the other Brazilian, Eduardo Junqueira.

The American Civil Liberties Union of Massachusetts, which represented De Souza, welcomed her release.

De Souza was arrested at a federal building in Boston on Jan. 30 after an interview with U.S. Citizenship and Immigration Services (USCIS) aimed at confirming that her marriage to her U.S. citizen husband was legitimate.

According to court papers, De Souza had been going through a process USCIS adopted during former Democratic President Barack Obama’s administration aimed at encouraging people living illegally in the country to seek lawful status.

Under regulations enacted in 2016, undocumented spouses of U.S. citizens could go through a process to seek waivers that would allow them to largely remain in the United States rather than leave the country while pursuing permanent residency.

The proposed class action said ICE has been detaining people who were going through that process. The ACLU said in January alone, ICE arrested seven while they were seeking permanent residency at a Massachusetts or Rhode Island USCIS office.