A would-be terrorist who was stopped in Turkey on his way to Syria had previously threatened a shopkeeper for selling satirical French magazine Charlie Hebdo.

Shamim Ahmed, 24, from Stepney, appeared at the Old Bailey today where he pleaded guilty to preparation of terrorist acts.

The court heard how Ahmed flew from Gatwick to Istanbul on January 11 last year, where he checked into a hotel and paid for five nights’ accommodation.

The next day, he booked a ticket for a flight from Istanbul to Gaziantep, by the Syrian border, and travelled there on January 13.

He left Gaziantep the following day and was detained at Oncupinar border crossing by the Turkish authorities.

On January 16, he was deported back to the UK where he was arrested by counter-terrorist police.

He was remanded in custody until sentencing on Wednesday, June 14.

Commander Dean Haydon, of the Met’s Counter Terrorism Command, said: “By pleading guilty Ahmed has admitted his intention was to join ISIS, a terrorist organisation, at a time when there was no doubt of the atrocities that they were committing. That makes him a very dangerous individual.”

Ahmed had previously admitted two counts of malicious communications after, in January 2015, he threatened to damage a bookshop if it sold copies of Charlie Hebdo shortly after a terror attack at the magazine’s offices.

The bookshop alerted police to the threats and Ahmed was arrested at his home.

In November 2015 he admitted the charges and was sentenced to 20 weeks imprisonment, suspended for two years, at Hammersmith Magistrates Court.

He was also handed an indefinite restraining order banning him from contacting the bookshop and ordered to carry out 300 hours of community service.