A Crossrail security guard from Shadwell, Tower Hamlets, has been jailed for six years for trying to join Islamic State in Syria.

Bangladeshi national Shamim Ahmed, 24, was stopped at the Syrian border in Turkey and returned to Britain last year. He was found with extremist material on his phone which he had used to research ways to join the terrorist organisation.

He pleaded guilty to preparation of terrorist acts and was sentenced at the Old Bailey to six years in prison with an additional year on licence. He said he only recognised sharia law.

Ahmed had a history of tell-tale extremist activity. He admitted threatening to damage a bookshop if it sold copies of the French satirical magazine Charlie Hebdo shortly after a terror attack at the publication’s offices.

In November 2015 he pleaded guilty to two counts of malicious communications and was given a suspended sentence and a year before he had sent an email to Prime Minister David Cameron threatening to wage jihad and slaughter against Israel and its allies, saying: “We are coming for you soon for revenge. Just wait and watch.”

At his sentencing hearing on Wednesday he began wagging his finger and mumbling the derogatory term “kuffar’”as he was sentenced before telling a dock officer: “I’m going to punch you in the face.”

Ahmed was sent back to the cells after shouting: “Wage jihad wherever we are… Target the civilians, tourist sites, tourist sites, inshallah [God willing].”

Sue Hemming, of the Crown Prosecution Service, said: “People thinking of travelling to Syria to engage in violence can expect to be returned to the UK to face prosecution and a potential prison sentence, with all that means for them and their loved ones.

“Ahmed’s plan to join IS has been thwarted and he will no longer pose a threat to the public in the UK or abroad.”

Questions may arise about the escalation of Ahmed’s radicalisation and his ability to work for Crossrail which has access to a number of sensitive sites across the capital.