A man has been taken into custody following an Armed Offender's Squad operation on Auckland's North Shore.
Students from nearby Albany Junior High School and Kristin School were kept inside for several hours on Monday afternoon as a precaution.
Police say they had been investigating a domestic violence incident since Sunday and were looking for the man involved.
They were told on Monday that the man was upset and may have access to a firearm.
Just after lunchtime, a local school reported a man had run across the grounds carrying what looked like a rifle.
Police say they were not sure if this was linked to their search, but sent about 50 police and the Armed Offenders' Squad to the area, closing roads and asking schools to keep students inside.
Inspector Peter Rayne says the man they were looking for was found at nearby Torbay beach, where he surrendered to officers and is in custody.
Mr Rayne says no gunshots were fired and no one was hurt.