LONDON - A British militant believed to have faked his own death while fighting in Syria in order to return home undetected was jailed for 12 years by a London court on Friday.

Imran Khawaja, 27, an amateur bodybuilder from London who used to work in an immigrant detention centre, admitted preparing for acts of terrorism, attending a training camp and possessing firearms.

Khawaja spent the first half of 2014 training alongside militants in Syria’s civil war and at one point posted video footage of himself holding severed human heads on social media.

Judge Jeremy Baker at Woolwich Crown Court handed down a 17-year extended sentence, comprising a 12-year custodial term and five years during which he has to report to police. He will have to serve a minimum of eight years in prison.

Baker called Khawaja a “willing and enthusiastic” participant in jihadism. “Your interest was sufficiently profound for you to travel to Syria to train for jihad. “I’m also satisfied, by the time you decided to return to the UK, you had completed your terrorist training,” the judge said.

Khawaja left from Heathrow Airport in January last year, travelling to a training camp in Syria.

Once there, he joined Rayat Al-Tawheed (Banner of God) - a group which became aligned with the Islamic State group, according to British police.

He also appeared in one of the group’s promotional videos, “Five Star Jihad”, which portrays daily life at the training camp.

The militant group falsely announced on social media that he was later killed on the battlefield. Police believe the reports were part of a plan to throw authorities off his trail.

In reality, he was making his way to Bulgaria, where he had asked his cousin Tahir Bhatti, 44, a taxi driver, to pick him up. Bhatti was sentenced to 21 months in prison.