Image caption Tarik Hassane, Suhaib Majeed, Nyall Hamlett and Nathan Cuffy (from left) deny the charges

Four men inspired by the Islamic State group plotted to kill a police officer, soldier or civilian in one or more "drive-by" shootings, a jury has heard.

Prosecutors told the Old Bailey the men had acquired a gun and ammunition, and planned to buy an untraceable moped.

They researched potential west London locations online, the court heard.

Nathan Cuffy, 26, Nyall Hamlett, 25, Suhaib Majeed, 21, and Tarik Hassane, 22, from west London, deny conspiracy to murder and preparing terrorist acts.

Opening the case, prosecutor Brian Altman QC said police scuppered murderous plans borne out of a "warped ideology" when they arrested the men in the autumn of 2014.

He said Mr Hassane had used his iPad to search the Google Streetview photo-mapping service for Shepherd's Bush police station and the Parachute Regiment Territorial Army Barracks at White City.

It appeared medical student Mr Hassane and Mr Majeed were discussing the purchase of a moped that could not be traced back to them, as well as a garage to store the moped and their weapon, he added.

Mr Altman said: "The evidence points to this being a plot to kill - a plot to execute a policeman or a soldier or, as I say, even an ordinary member of the public - in one or more assassinations either involving a drive-by shooting or a shooting on foot and then a speedy escape by moped."

'Lone wolf'

Mr Hassane was alleged to have been leading the plot and to have issued instructions to Mr Majeed, who was studying physics at King's College London at the time of his arrest, the court heard.

The jury was told police found four guns and ammunition in Mr Cuffy's bedroom and he has pleaded guilty to firearms offences. Mr Hamlett, said to be the alleged "middle man" who passed on a weapon to Mr Majeed, has admitted transferring the gun and ammunition.

When officers arrived at Mr Majeed's home, a gun, silencer and bullets were thrown out of his bedroom window, the court heard.

Prosecutors said there were believed to be more people involved in the plot who were not on trial.

The defendants were arrested in September 2014, except for Mr Hassane, who was studying in Sudan. Mr Altman alleged the evidence in the case suggested he was pressing on with the plot as a "lone wolf terrorist".

Mr Hassane had pledged his allegiance to the IS group and the plot received "important direct and authoritative encouragement" when the group's official spokesman issued a fatwa to kill disbelievers in the West, the prosecutor told the court.

The court heard that when Prime Minister David Cameron announced new counter-terrorism laws Mr Hassane wrote on a messaging service: "LOOOOOL David Cameron is getting himself ready for my turn up."

Police also found images on Mr Majeed's mobile phone of Mr Hassane apparently posing with a gun, and in one image he also held a book on Osama bin Laden, the jury was told.

The trial continues.