WASHINGTON (CN) – During the first nine months of 2017, federal immigration officials detained and held indefinitely every asylum seeker that entered the US.

Prior to that, according to a class action suit that just won a big victory in D.C. federal court, 90 percent of asylum seekers were released while they navigated the complex legal process of relocating to the United States to escape torture or persecution in their home country.

These raw numbers helped convince U.S. District Judge James Boasberg to issue an injunction Monday, ordering an end to the current detention policy and releasing several named plaintiff’s in a lawsuit seeking to permanently end the detention policy now being enforced by Immigration and Custom Enforcement, the Department of Homeland Security, and Attorney General Jeff Sessions, despite longstanding federal policies encouraging the release of asylum seekers.

“[This order] does no more than hold the Government accountable to its own policy, which recently has been honored more in the breach than the observance,” Boasberg wrote in a 38-page opinion.

Asylum seekers have been making headlines as the Trump administration works to roll back the number of foreign people allowed in the country.

In this case, brought by a group of asylum seekers currently in detention, one of which has been behind bars for over 18 months, the plaintiffs claim the defendant federal agencies are ignoring the “Parole Directive” order in ICE’s own guidelines.

This agency directive gives power to the secretary of Homeland Security to invoke parole authority “for individuals who are ‘neither a security risk nor a risk of absconding,’ and who meet one or more of a series of conditions – namely, ‘for urgent humanitarian reasons or significant public benefit,” Boasberg wrote.

The ACLU, which helped argue the case on behalf of the asylum seekers, says the plaintiffs had all passed the “credible fear screening” meaning they qualified for, and would likely be granted, asylum and, in some cases, seekers were granted asylum but still detained while the government appealed their request.

It’s at this point that Boasberg finds the biggest problems with the government’s current detention policy: these asylum seekers have jumped through the required hurdles, and now the fed should be paroling them in line with the agency’s policies.

“They are not challenging the outcome of ICE’s decisionmaking, but the method by which, parole is currently being granted (or denied),” he wrote, pointing to the Accardi doctrine, a 1954 Supreme Court decision which says agencies must follow their own policies. “They are correct. ‘It has long been settled that a federal agency must adhere firmly to self-adopted rules by which the interests of others are to be regulated.’”

In a statement released by the ACLU shortly after the injunction was issued, the group pointed to the named plaintiff, Ansly Damus, as an example of someone who attempted to legally seek asylum but was treated illegally and against the agency’s own policies.

“Damus committed no crime,” wrote the ACLU. “When he arrived in the U.S., he presented himself to immigration authorities and requested asylum. He passed his credible fear interview and was granted asylum by a judge … Despite that, he has remained behind bars while the government appealed his grants of asylum.”

“The Trump administration had put Damus behind bars indefinitely alongside thousands of other asylum seekers like him,” the statement said.

Representatives of the agencies named as defendants in the class action, including the Department of Homeland Security, did not immediately respond to a request for comment.