A wanted criminal pointed a gun in the face of a man and pulled the trigger as he tried to escape from police.
Members of the public flooded police with 999 calls as plain clothes officers chased the suspect in West Hampstead, north-west London.
Witnesses said the suspect threatened the detectives with a handgun as he was pursued along a busy shopping street.
He also pointed it in the face of a moped rider and pulled the trigger three times after he stopped and attempted to intervene.
Ballistic tests were underway today to find out why the weapon did not fire.
Armed police arrested two men and discovered a bag containing three guns. A quantity of diamonds wrapped in paper were found in the man's pocket.
The chase began at around 3pm yesterday when officers from a specialist Brent unit spotted a man who was wanted for violent offences.
When they stopped his Vauxhall Astra in West End Lane the man pulled out a gun and ran off.
The officers gave chase as the suspect crossed a railway line near West Hampstead tube station and members of the public dialled 999 to update police.
The suspect was eventually found hiding beneath a car a short distance away in Blackburn Court.
Police said the moped rider was unhurt but had been left deeply shocked and is receiving support.
A Metropolitan Police spokesman said: "Officers from Brent Borough stopped a car in West End Lane at approximately 3pm yesterday. The car contained two men.
"One of the men in the car produced a firearm and aimed at officers before making off on foot across a railway line.
"The officers gave chase during which a member of the public attempted to detain one of the suspects.
"He aimed the firearm at the member of the public and continued running. The man was not injured.
"Both suspects were arrested by armed officers a short distance away in Blackburn Court. Three firearms have been recovered."