A British jihadi who faked his death in an attempt to secretly return to England from Syria was sentenced Friday to 12 years in prison.

Imran Khawaja, who joined a faction aligned with the Islamic State group and attended an extremist training camp in Syria for six months, had appeared in the group's online propaganda videos — including one in which he posed with a man's severed head.

Khawaja's lawyer said the 27-year-old wanted to return to Britain because he had "had enough" of the camp. The jihadi spread false news of his own death online in order to return home unnoticed, and his death was reported in several newspapers. But his plan was foiled when he was arrested along with his cousin in June by port officials as they tried to enter England from the southern town of Dover.

Passing sentence, judge Jeremy Baker said Khawaja was a risk to the public and described him as a "willing and enthusiastic" participant in extremist recruitment films.

"You took part in the production of films designed to promote the Islamic State cause and encouraging U.K. Muslims to join you in jihad," he said. "Your interest was sufficiently profound for you to travel to Syria to train for jihad."

Khawaja had admitted preparation of terrorist acts, attending a terrorism training camp, receiving weapons training and possessing a firearm for terrorism use.