Immigration and Customs Enforcement agreed on Thursday to release three people who were detained while they were in the process of obtaining green cards. The fate of three more detainees in a class action lawsuit will be considered in federal court Friday.

ICE officials promised in August to consider releasing the six detainees in the class action suit, which was filed in 2018. That didn't happen, and attorneys for the ACLU say ICE failed to provide documentation of why. Judge Mark Wolf ordered four ICE officials to appear in court Thursday to explain, but before that testimony happened, ICE agreed to release three of the detainees.

“Rather than fight that out, the government agreed to let these three people go home and be with their families, which is enormously important," said Matthew Segal of the ACLU, which is representing the six detainees. "And now what we’re going to continue to do is fight for the reunification of three other families, and also to get to the bottom of what happened here, which are substantial violations of laws.”

Segal says federal regulations allow spouses of U.S. citizens to remain in the country while they try to obtain lawful immigration status.

“And what we’re saying is people have been detained and their detention has been continued [which] is in violation of law," he said. "And that’s obviously deeply important and deeply troubling.”

The decision to release the three detainees does not end the federal government's immigration cases against them.

Marcos Charles, the acting director of the Boston ICE office, testified that two of the detainees still in custody present a danger to the public. One of them was convicted of assault against a police officer, and another faced charges of selling heroin. Charles's testimony is expected to resume today regarding the third remaining detainee.