CHICAGO (CBS) — A 21-year-old Bolingbrook man who pleaded guilty to trying to join ISIS has been sentenced to 3 years, 4 months in prison — but he is expected to be freed in time to enroll in college next fall.

Mohammed Hamzah Khan had been arrested two years ago at O’Hare on the verge of leaving the country to join ISIS.

READ MORE: Chicagoans React To President Biden' Plan To Tackle The City's Gun Probem

His cooperation with the government led to a sentence of just under 3 ½ years.  And with time served, that means he’ll be freed next year.

The judge ordered Khan under supervised release for 20 years — seen by observers as an uncommonly long time.

READ MORE: Minooka Community High School District 111 And Stanley Fabian Come To Agreement On Lawsuit

Outside court, his father, Shafi Khan, was thankful his son will at least be free soon.

“We are thankful to the judge, to the FBI and the government, what they decided for our son and his future. And we thank God that the judgment has come out,” he said.

At the end of the sentencing hearing, the judge told Khan: “I hope you appreciate what happened in this case…  You, who profess to regard this country as your enemy: Here you have not been treated as an enemy.”

MORE NEWS: Tornado Victims Displaced Having Trouble Finding New Housing In Post Pandemic Era