Several shots were fired during a dairy robbery in Auckland's Mangere, prompting a police chase where more shots were fired.
Two men allegedly stole the store's till after firing a firearm at around 2pm on Monday before fleeing in a waiting vehicle.
The car was later spotted in Manuwera, but a police chase had to be abandoned after the offenders shot at one of the police cars.
Three men, aged 21, 26 and 29, were arrested after being tracked down with a police helicopter.
"There were four staff members in the dairy at the time as well as members of the public, including children. Thankfully no one was injured," Inspector Dave Glossop said.
The victims were shaken but are being supported by police. The officer who was shot at is also being supported.
"This was a very serious incident and we are relieved that no one was injured," Insp Glossop said.
Police are continuing to investigate the incident.