A man has been sentenced to 10 years in federal prison for scamming undocumented immigrants out of more than $600,000 on the promise of gaining residency status.

James Keegan, 57, pleaded guilty to one count of wire fraud in March, according to the the U.S. Attorney’s Office of the Northern District of Illinois. He was sentenced Wednesday.

Keegan, of Cicero, ran a fraudulent immigration advocacy service from west suburban Berwyn for nine months in 2017, prosecutors said. He falsely claimed he used to work as an attorney with the U.S. Department of Homeland Security and had connections there.

He offered a variety of services, including the promise of citizenship in exchange for a fluctuating price, prosecutors said.

More than 200 undocumented immigrants paid Keegan in excess of $687,000, often in cash, prosecutors said. The average fee was about $3,000 per applicant.

However, Keegan was never an attorney, never worked for DHS and never filed immigrant applications on behalf of his clients, prosecutors said. He spent the fees on personal fees, including gambling losses.

Keegan created fake approval notices and tried buying bogus immigration documents to conceal the scheme, prosecutors said. Officials who searched his phone and computers found he tried purchasing 35 blank residency cards from an “online provider of lovely identification documents,” prosecutors said.

As he was running the fraudulent services, Keegan was on court supervision after being released from federal prison for a previous conviction involving investment fraud, prosecutors said.

Read more on crime, and track the city’s homicides.