Four British Muslim men plotted to murder police officers and soldiers in an Islamic State-style terrorist attack in west London, a court has heard.

Nyall Hamlett, 25, Nathan Cuffy, 26, Suhaib Majeed, 21, and Tarik Hassane, 22, all from London, are on trial for preparation of terrorist acts and conspiracy to murder. The defendants were arrested in September and October 2014.

The suspects, including two students, had already acquired a gun, silencer and ammunition, and were looking to buy a scooter, prosecutor Brian Altman QC told the Old Bailey court on Monday.

The group allegedly researched Shepherd’s Bush police station and 4 Parachute Regiment Territorial Army barracks in White City on Google Street View.

Opening the case, prosecutor Altman said the defendants had already planned an escape route, meaning more than one killing was afoot.

"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,” he told the court.

The group were allegedly influenced by the rise of the Islamic State (IS, formerly ISIS/ISIL) and events in Syria and Iraq.

“With their arrests, the police successfully disrupted a plot to kill a police officer, a soldier or possibly even a civilian, in one or more terrorist attacks, which, if the plot had been allowed to run its course, would have resulted in a terrorist murder or murders on the streets of London."

In September 2014, one of the suspects, Hassane, allegedly pledged his allegiance to IS. Soon after, the group’s plan received “important, direct and authoritative encouragement” from the extremist group itself, the court heard.

"Although the finer details of the plot may not have been worked out and finally agreed upon, the defendants had sufficiently advanced their plans to the point where, the day before the first arrests in late September 2014, they had acquired a self-loading pistol, a magazine with ammunition suitable for use in it and a silencer,” Altman told the court.

"The evidence suggests that Hassane and Majeed were discussing the purchase also of a moped that could not be traced back to them, as well as a garage to store the moped with the gun.

"They were also trying to source the money to buy the moped. At one stage they spoke about needing to find £2,000."

All four suspects from west London deny conspiracy to murder and preparation of terrorist attacks.