British prosecutors say four men inspired by a call by the Islamic State group to kill "disbelievers" plotted to murder a police officer or soldier on the streets of London.

The men, aged between 21 and 26, are accused of acquiring a pistol, a silencer and ammunition as part of their plans.

The four went on trial Monday charged with conspiracy to murder and preparation of terrorist acts. They deny the charges.

Prosecutor Brian Altman told jurors at London's Central Criminal Court that the defendants' arrest in late 2014 "successfully disrupted a plot to kill a police officer, a soldier or possibly even a civilian, in one or more terrorist attacks."

He said they were encouraged by IS spokesman Abu Muhammad al-Adnani al-Shami's call to kill disbelievers in the West.