A U.S. citizen who ICE detained for weeks is suing the agency, alleging it violated his Constitutional rights.

The lawsuit holds that Rony Chavez Aguilar was held in ICE custody for nearly three weeks without being able to see a judge, and without knowing why he was being detained.

Those officers initially arrested Aguilar on drug charges, according to Roth. He pleaded guilty, and spent about two weeks in county jail for the offense. After the two weeks were up, he would have been free to go. But ICE thought he was undocumented, and wanted to deport him.

The officers kept him in the county jail so agents with ICE’s Chicago field office could take him into custody. According to the complaint, they picked him up on or around March 7 and moved him to the Boone County Jail in Burlington, Kentucky, where they contract out space to detain people facing deportation.

At that point, Aguilar told them he was a U.S. citizen. They didn’t believe him.

“He said, ‘Hey, I’m a citizen!’” said Charles Roth, who is representing Aguilar. “And basically they said, ‘Tell it to the judge.’”

Then they didn’t let him see one.

Roth, who is also the litigation director for the National Immigrant Justice Center, said many other immigrants find themselves in the same situation as Aguilar—detained for days or weeks without knowing what charges they face and without getting to defend themselves before a judge—and that he hopes a judge will let those people join Aguilar in a class action suit.

If Aguilar is successful, it could present a significant challenge for Trump’s mass deportation efforts. ICE doesn’t comment on ongoing litigation.

The suit comes at a time when President Donald Trump and Homeland Security Sec. John Kelly are moving rapidly to expand immigrant detention and deport more people. And the suit highlights one of the biggest challenges facing America’s immigration system: the massive backlog in immigration court that makes some immigrants wait months before they can see a judge.

It also highlights another ongoing challenge for ICE: accidentally arresting U.S. citizens. Syracuse University’s Transactional Records Clearinghouse found that from 2008 to 2012, the agency asked local jails to detain 834 U.S. citizens so they could move to deport them. As Trump’s efforts to speed up deportations continue, it’s likely more American citizens like Aguilar will be caught in the dragnet.

According to the complaint, Aguilar was born in Guatemala and came to the United States legally in 1991. His mother became a naturalized U.S. citizen when he was 14, according to the complaint, and he became a citizen on Feb. 27, 2001. In January, ICE asked Kentucky police officers who had arrested Aguilar to hold him in a jail there longer than they otherwise would have so the agency could pick him up.

When the complaint was filed, ICE hadn’t yet filed what’s called a “Notice to Appear” in immigration court against Aguilar. That notice would be the document officially charging him, and would require him to go to court.

“ICE Chicago did not obtain a judicial warrant to arrest Plaintiff; has not provided a sworn, particularized statement of probable cause; has not promptly brought him before a detached and neutral judicial officer for a probable cause hearing; or has not brought him before a judge to understand the charges against him and receive important advisals regarding his due process rights, amongst other procedural protections,” the complaint says.

Roth said Aguilar was released from detention shortly after they filed the suit on March 27.

Roth said Aguilar’s situation is fairly common, and he hopes a federal judge will declare that it’s illegal for ICE to detain immigrants for more than 48 hours without letting them see a judge.

Aguilar’s case isn’t the only one moving through federal courts that could significantly upend the way immigrant detention works. A federal judge in Colorado recently ruled that upwards of 60,000 immigrants held in a facility managed by a for-profit prison company could launch a class action lawsuit against that company. The plaintiffs in the suit, Menocal v. GEO, allege that the company violated a federal anti-slavery statute by forcing them to do manual labor for low wages or no wages at all, under threat of solitary confinement.

As Trump detains more immigrants, lawsuits like this one will likely become more common. And as was the case with the travel ban, the federal judiciary could be the biggest hurdle for Trump’s plans.