Image copyright West Midlands Police Image caption Naweed Ali, Khobaib Hussain and Mohibur Rahman were sentenced at the Old Bailey

Three would-be jihadists who dubbed themselves the Three Musketeers have been jailed for life for plotting an attack on a police or military target.

Naweed Ali, 29, Khobaib Hussain, 25, both of Sparkhill, Birmingham, and Mohibur Rahman, 33, of Stoke-on-Trent, had planned a "mass casualty attack".

Tahir Aziz, 38, also from Stoke, was given a life term for the same crime.

Old Bailey judge Mr Justice Globe said the men were gripped by a "long-standing, radical, violent ideology".

When police arrested the four men in August last year they found weapons including a meat cleaver and a partially constructed pipe bomb.

Ali, Hussain and Rahman - who called themselves the Three Musketeers in group messages - were each sentenced to a minimum of 20 years in prison. All three refused to attend court.

They have all previously served prison sentences for terrorism offences.

Aziz, who joined the group days before the arrests. was sentenced to a minimum term of 15 years in prison.

Image copyright West Midlands Police Image caption Tahir Aziz, 38, from Stoke-on-Trent, was sentenced to a minimum term of 15 years

Mr Justice Globe said he was satisfied it was only because of the work of undercover police and the security services that a terrorist attack "involving a considerable loss of life" was stopped.

The purpose of the planned attack was "to kill or injure and cause terror" and "to promote an anti-Western ideology," he said.

Police say the men, who had pleaded not guilty, had been inspired by so-called Islamic State, also known as Daesh.

Fake courier firm

The four men were arrested on 26 August last year after counter-terrorism officers set up a fake courier firm, called Hero Couriers, where Hussain and Ali were offered driving shifts.

When Ali arrived for his first shift at the fake Birmingham depot MI5 officers secretly searched his Seat Leon car.

Inside they found a JD Sports bag containing the partially-constructed pipe bomb and meat cleaver with the word "kafir" - meaning non-believer - scratched on it.

An imitation gun, cartridges, a 9mm bullet, latex gloves and industrial tape were also recovered, while a samurai-style sword was found in Aziz's car.

Image copyright West Midlands Police Image caption Police found a meat cleaver with the word Kafir scratched on it

Police said the men had looked at violent material online, joined extremist social media groups and bought new mobile phones to help them further their plans.

They used a Three Musketeers image from the Disney cartoon as a logo on encrypted Telegram messages sent between them.

The court heard how neighbours Ali and Hussain had previously been jailed for terrorism offences.

They had attempted to join an al-Qaeda training camp in Pakistan in 2011. However, when they arrived back in the UK they were arrested and the following year both pleaded guilty to engaging in conduct in preparation of terrorist acts.

The pair first met Rahman - who had been convicted of possessing an al-Qaeda magazine - while in prison.

'Al-Qaeda training'

During the four-and-a-half-month trial, the defence claimed incriminating evidence had been planted by an undercover officer, known as "Vincent", who posed as the boss of the fake courier firm.

In a statement issued after sentencing, a solicitor representing Ali and Hussain raised questions about whether officers had kept their police notebooks up to date, saying she was concerned the jury had "got it wrong."

Gareth Peirce said there was a "clear distortion of the normal criminal justice process" in the case, which was partly held in secret and saw some officers give evidence anonymously.

She drew parallels with the Birmingham Six, in which a group of Irish men were wrongly convicted of bombing two pubs in 1974.

Image copyright West Midlands Police Image caption Officers covertly photographed the men meeting in August last year

However, the jury rejected the defence's claim that Vincent had planted the cleaver and the pipe bomb in Ali's car.

Sentencing the men, Judge Globe rejected the claims as "totally unfounded".

He said there had been "a root and branch attack on the credibility of just about every prosecution witness in the case".

Detective Chief Superintendent Matt Ward, head of the West Midlands Counter Terrorism Unit, said the sentences reflected "the level of danger that these four men represented to the public".

"They were committed to carrying out an attack which would have undoubtedly resulted in loss of life," he said.

"This is the second time three of these individuals have been convicted of terrorism offences after planning an attack.

"Although much work is being done in prisons and following the release of individuals it is clear that more needs to be done."