The men allegedly robbed the Idlewild Superette in Mangere before fleeing from police.

Armed men allegedly shot at a police car as they fled from a dairy robbery.

Police were called to Mangere, south Auckland after an armed robbery at the Idlewild Superette about 2pm on Monday.

The car was pursued by police, but the chase was soon abandoned after a shot was fired at a police car.

Three of the men then abandoned the car, and fled through the grounds of Rowandale School in Manurewa.

They ran across the school field and over a fence onto a neighbouring property.

The school went into lockdown for about an hour while police searched for the men.

School officials alerted parents to the incident via social media, stating all children were safe and accounted for.

Inspector Dave Glossop said there were four staff members in the dairy at the time of the alleged robbery, as well as members of the public, including children.

"The victims are obviously shaken by what has occurred and are being supported by Victim Support and police," he said.

"The police officer who was immediately following the vehicle and was allegedly fired upon is being supported by his colleagues and his welfare will be a priority.

"This was a very serious incident and we are relieved that no one was injured."

A worker at the family-run superette, who wished to remain anonymous for safety reasons, said the gun was fired twice inside the shop to intimidate staff.

He said it was the first burglary the dairy had seen in the 10 years it had been in the family's hands.

"It was really scary . . . even the customers and community were shocked, they call it their dairy."

He said the men took the till, which had anywhere up to $1000 inside it.

However, the incident wasn't as bad as it could have been, given the local school had let out at 2pm instead of 3pm - meaning lots of children were crowded around the shop.

The man said it was sad that people were so desperate for cash that they would resort to shooting a gun indoors and endangering human lives.

Three men, aged 29, 26, and 21, were in custody and were assisting police with their enquiries, Glossop said.