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: Man Shot And Killed In Dispute Outside West Chatham Home

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: City Was Warned About Thousands of Corroding Light Poles But Failed to Fix Many, CBS 2 Investigation Finds

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: Chicago Weather: Rain Arrives Sunday