Armed police were sent into an area of Gloucester and a street sealed off after reports of a man with a gun. The male was spotted on Sunnycroft Mews near Stroud Road on Tuesday afternoon.
The road was closed. A 17-year-old was later arrested carrying a pellet-firing BB gun as police warned he had risked a confrontation with armed officers.
Supt Nick Jefferies said: "It is extremely difficult to distinguish between a BB gun and the genuine article."
He added: "We have no choice but to treat these incidents as genuine."