A U.S. citizen is suing the Immigration and Customs Enforcement agency, claiming he was arrested and held in jail for almost three weeks because they didn’t believe he was in the country legally.

ICE agents are expressly prohibited from detaining U.S. citizens. But in a new suit filed Monday, Rony Chavez Aguilar alleges ICE agents held him in jail for 18 days without allowing him to see a judge.

Aguilar, who was born in Guatemala and became a U.S. citizen in 1999, was serving two weeks in county jail for drug charges. But instead of releasing him at the end of his sentence, Kentucky authorities held him for an extra two days so that he could be transferred into custody of the ICE Chicago field office, which covers Illinois, Indiana, Kansas, Kentucky, Missouri and Wisconsin.

On March 9, the complaint alleges, the agency transferred Aguilar to the Boone County Jail in Kentucky, an ICE-contracted facility that holds people facing deportation. For 18 days, he was not allowed to see a lawyer or talk to a judge.

“He said, ‘Hey, I’m a citizen!’” Aguilar’s attorney, Charles Roth, told the Daily Beast. “And basically they said, ‘Tell it to the judge.’”

The Daily Beast reports Aguilar was released “shortly after” the suit was filed Monday. At that point the agency had not yet filed a notice to appear, which would start immigration proceedings.

“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, among other procedural protections,” the complaint alleges.