A Tooting cyber-jihadist who helped the Taliban has been sentenced to 12-and-a-half years in prison in the US – but could be freed in months after being detained for a decade awaiting trial.

Babar Ahmad, 40, has already spent 10 years behind bars both in the UK and the US – after losing a fight against his extradition two years ago.

Ahmad pleaded guilty in December to providing material to support the Taliban and Chechen mujahideen by using websites to raise money, recruit fighters and provide equipment such as gas masks for the Taliban.

Ahmad’s admission came  decade after he was first arrested in London in 2003.

He spent eight years behind bars from 2004 until he was extradited in 2012, along with other men including radical preacher Abu Hamza.

At the time it was the longest period any British citizen had been detained without charge since the September 11 attacks.

He was accused of being the mastermind behind the world’s first English website dedicated to jihad and operating the now defunct Azzam.com websites.

He was prosecuted in the US because of the role American authorities played in shutting down the Azzam network.

Delivering sentence in Connecticut, Judge Janet Hall said by supporting the Taliban, Ahmad helped protect Osama bin Laden while he was plotting the September 11 attacks.

However, she acknowledged Ahmad had no knowledge of the plot.

Judge Hall said he would be given credit for the 10 years he has already served.

The BBC reported that Ahmad’s legal team believe he could be released within about seven-and-a-half months.

A statement posted on the Free Babar Ahmad Facebook said: “All praise be to God, today we are finally coming to the end of a very long journey which started over 10 years ago.

“It has been a very difficult and tiresome struggle but at last, we can see light at the end of the tunnel.

“We are elated that this matter is now coming to a close and look forward to welcoming Babar home once more after over a decade.

“We wish to extend our heartfelt gratitude to Babar’s legal team who have worked incredibly hard for the past two years in both fighting the case and supporting Babar.

“We also can never be grateful enough to the hundreds of thousands of our supporters from all over the world who have stood by us and been our companions on this epic journey.

“Verily after hardship there is ease.”