A drug dealer has been jailed for attempting to smuggle a passport and £2,000 in cash to a suspected terrorist who is thought to have fled Britain in the back of a lorry and is seeking to join Islamic State.

Ali Mohammed Said, 23, from Camden, north London, was arrested as he tried to board a Eurostar train to Brussels with a false passport, money and a new mobile phone with one number in Belgium stored in the memory.

The passport had the photograph of a man who can only be referred to only as CF, because he was once under a terrorism prevention and investigation measure (TPIM) and police have not issued an appeal since his disappearance.

The passport had been reported missing by a man of the same surname as CF who said he had lost it on a bus. A new name had been inserted.

Said, who was on bail for drug dealing at the time of the offence, was jailed for five years at Blackfriars crown court.

Judge John Hillen told him: “You are not a man motivated by ideology, but by money – a common criminal – but it is extremely concerning that a common criminal, in your case a drug dealer, was assisting those who maybe seeking to harm the public on a wide and terrifying scale.

“A message has to be sent to you and your friends, however unwitting your involvement in this sort of crime, that it will be met with severe and immediate imprisonment.”

CF had been arrested on three previous occasions on suspicion of breaching the TPIM but never charged and was released from the order when it expired in January this year.

His passport was removed by Theresa May, the home secretary, using royal prerogative powers but he managed to travel to Brussels where he was awaiting a false passport to continue to Syria.

The case raised questions from Yvette Cooper, the shadow home secretary, concerning the government’s terrorism measures after the Guardian first reported on it last month.

The 26-year-old man had lived in Dartmouth Park, north London.

He has a long history of involvement with al-Qaida-linked groups and is thought to have been seeking to join Isis, sources say.

CF is a close associate of Mohammed Mohamed, who fled from a mosque dressed in a burqa while under a TPIM last November.

He also knew Ibrahim Magag who escaped from a TPIM on Boxing Day 2012 apparently by jumping in a cab at Euston railway station in London.

CF has a history of involvement with terrorist groups dating back six years. In 2008 he allegedly attempted to travel to Afghanistan to fight “jihad” and engage in suicide operations alongside another man.

He was arrested and charged with seeking terrorism training overseas but while electronically tagged on bail he absconded using a false Portuguese passport.

He travelled to Somalia in June 2009 where he allegedly attended a terrorist training camp and was involved in fighting alongside al-Shabaab, a group linked to al-Qaida that was behind the Westgate mall attacks.

From there, he provided advice on travelling to Somalia to others and attempted to recruit fighters in Britain to join them, including offering to help another man to travel to Somalia in 2010.

He was also engaged in seeking funds for al-Shabaab and may have been involved in planning attacks.

Shortly before his arrest, he was allegedly involved with Mohammed Mohamed’s plans to attack western interests in Somaliland. Mohamed’s plans had included an attack on the Juba hotel in Mogadishu in August 2010.

CF was arrested by Somaliland authorities alongside Mohamed in Burao on 14 January 2011 and detained in Hargeisa prison for two months before being deported to Britain where he was put under a TPIM.

In a high court judgment, Lord Justice Lloyd Jones said CF had played a substantial role in the British network in Somalia and that his involvement was “undoubtedly real and substantial”.

“I am entirely satisfied that the secretary of state was and remains reasonably entitled to hold a reasonable suspicion and a reasonable belief that CF had engaged in terrorism-related activity,” he added.

Said, a Somali national born in Mogadishu, had arrived in Britain with his mother and three brothers after his father was killed in the civil war.

He had fallen in with a group of Somalian youths in the Camden area and was arrested for supplying cannabis in 2008 and given an antisocial behaviour order, which he breached on 11 occasions.

He continued living with his mother, but was arrested for offences of threatening and abusive behaviour and affray.

On 18 February an undercover police officer spotted him approaching another man, carrying out “what appeared to be a drug deal,” Mark Dawson, prosecuting, said.

When he fled, he threw a bag containing 15 wraps of heroin and two wraps of crack cocaine to the ground and was arrested.

On 23 July, while on bail for the drugs offences, he was arrested at St Pancras station and the false passport discovered in a rucksack.

Said was unemployed but was planning to start a degree in accounting and finance at Middlesex University after deciding to turn over a new leaf, James Skelsey, defending, told Blackfriars crown court.

He had met an individual at a Somali cafe who gave him the offer of “making some money” on a trip to Europe, but didn’t know who the passport was for.

Said was jailed for five years on Friday – 20 months for possession of a false passport, four months for refusing to divulge his iPhone pin, and three years for possessing Class A drugs with intent to supply.