A Glen Ellyn man was sentenced to 12 years in prison Monday for tackling an Uber driver and then forcing him to go to an ATM in an attempt to withdraw money.

Joshua Phillips, 21, faced a minimum seven-year prison term under a plea agreement. Even though the robbery plan failed, DuPage Judge Robert Miller said Phillips didn’t qualify for a lesser term because of his criminal history.

The judge noted Phillips’ family “moved from Chicago to get away from the criminal element,” but he added: ”It seems to me that the defendant is the criminal element.”

Phillips’ mother had taken the stand earlier at Monday’s hearing, saying she and her husband had moved to Glen Ellyn from the West Side of Chicago when their son was in seventh grade, hoping to shield him from gang activity and other bad influences.

Prosecutors, though, said Phillips had been getting into trouble, including a previous armed robbery, since his early teenage years.

He pleaded guilty in September to the November 2016 armed robbery of the Uber driver. The driver told police that he was standing outside his vehicle looking for potential passengers when two men tackled him.

The driver told police that Phillips had a handgun; it was later determined to be a BB gun.

The pair forced the driver to take them to an ATM, but the driver only had $12 in his checking account and the cash machine would not dispense any money, police said. The pair kept the driver hostage for about an hour before stopping in a Walmart parking lot near Glen Ellyn. The driver was able to run away, and the two men drove away with his car, according to police.

The car was recovered the following day, authorities said, not far from Phillips’ residence. He was arrested about a week later, along with another suspect, Alonzo Alexander, of Wheaton.

Under the terms of his sentence, Phillips could be released in about four years, with available credits, including almost two years spent in county jail as his case progressed.

Alexander has also pleaded guilty in the case and is due to be sentenced next month.

Clifford Ward is a freelance reporter.