Police were called to the port town shortly after 7.30pm after reports were received a teenager had fired a gun at a passing vehicle near the container terminal.
He was later spotted entering a public toilet on George St, and "brandishing what was believed to be a slug gun", Senior Sergeant Mel Aitken, of Dunedin, said.
"Anyone seen carrying a firearm we have to treat as serious."
Armed police patrolled the area, and were called to Port Chalmers School following reports the teenager was sitting on the swings.
He was arrested at 8.40pm.
The 15-year-old will appear in the Youth Court today on charges of unlawfully carrying an imitation firearm and possession of cannabis.
"This incident sparked an armed police call-out and potentially someone could have been shot," Snr Sgt Aitken said.