Two British men who travelled to Syria to join an al-Qaida-linked terrorist group have been jailed for nearly 13 years.

Mohammed Nahin Ahmed and Yusuf Zubair Sarwar, childhood friends from Birmingham, travelled to the war-torn country in May last year after contacting Islamist extremists.

The men, both 22, were arrested on returning to the UK in January and pleaded guilty to one count of engaging in preparation of terrorism acts contrary to Ssection 5 of the Terrorism Act.

Sarwar’s family had reported him missing after they found a letter saying he had left to join a terrorist group called Kataib al-Muhajireen (KaM) to take part in jihad.

They were sentenced at Woolwich crown court in London on Friday to 12 years and eight months in prison with an extended licence period of five years.

Judge Michael Topolski said: “They willingly, enthusiastically and with a great deal of purpose, persistence and determination embarked on a course intended to commit acts of terrorism.”

The judge added: “The consequences for them are dramatic and distressing for the families concerned.

“It’s with no enthusiasm the court sentences young men to significant terms of imprisonment.

“A grave crime has been committed. The sentence in each is an extended sentence of 17 years and eight months.”

Sarwar, wearing a tie and waistcoat, and Ahmed, dressed in a suit and tie, showed no emotion during the hearing.

The bearded defendants, both wearing glasses, were flanked by four security guards in the dock.

The judge said he had imposed a longer licence term after reaching the “clear conclusion” that Sarwar and Ahmed were “dangerous”. He said they were both “fundamentalists who are interested in and deeply committed to violent extremism.”

They will serve two thirds of their custodial sentence before being considered for release, he added. Topolski rejected arguments from lawyers for Sarwar and Ahmed that the sentence should be reduced because the pair joined a group fighting the Syrian president, Bashar al-Assad.

“This was not a spontaneous response to travel to a humanitarian crisis,” he said. “This was a well-planned operation put into action for very different reasons.”

Topolski said that while he concluded Sarwar and Ahmed had not planned an attack in the UK, there was evidence to show “without doubt” that the men were travelling to Syria “intending on jihad” and “martyrdom on the battlefield”.

Traces of military-grade explosives, including TNT and nitroglycerine, were also found on their clothes and trainers.

DCS Sue Southern, head of the West Midlands police counter-terrorism unit, said: “This case typifies the challenges both police and families are facing when it comes to young people being influenced to join the conflict in Syria or Iraq.

“These two men had no previous connections to extremist organisations and no police record. They were not known to us.

“However, one of them was clearly being influenced by extremists he was talking to online, and he in turn was radicalising his friend.

“They both deceived their families and, by the time we were contacted, serious offences had already been committed. We had no choice but to arrest and charge the pair on their return.”