ISIS flag
ISIS flagReuters

 A 19-year-old who spent his student loan traveling to the Turkey-Syria border and wanted to join the Islamic State (ISIS) group is behind bars in Britain, police said Thursday.

Yahya Rashid paid £906 (1,300 euros, $1,400) for himself and four friends to travel to the Turkish border town of Gaziantep in February.

He stayed in an ISIS safe house but shortly before he was due to cross into Syria, he changed his mind and returned to Istanbul.

Rashid, aged 18 at the time, was then detained by Turkish police and deported back to Britain, where he was arrested on his arrival.

Police believe his traveling companions did cross into Syria and are still there.

Rashid, whose family is originally from Somalia, was sentenced to five years in a youth offenders' institution Wednesday for terrorism offenses.

"You told the jury you had never held a gun in your life and there is no reason to believe that is untrue," Judge Philip Katz told Rashid as he passed sentence. "But goodness knows what you would have gone on to do as a foot soldier of ISIS."

Rashid's lawyer Mark McDonald claimed his client had wanted to live in an "Islamic utopia" but not fight.

AFP contributed to this report.