Whakatāne High School went into a brief lockdown around 1pm today, after concerns around a member of the community in the vicinity.
A group of students noticed the man behaving erratically, who then started threatening the students.
The students were able to notify their teachers, who were then able to notify the Police.
"Police have taken a man into custody after a report they allegedly had a weapon on the grounds of a school on Goulstone Road.
"Police advised the school to lockdown for a brief period of time, until the man was located as a precaution," a Police statement said.
An update from the school at 1:38pm said, "The Police have now detained the person of interest, and we have been given the all clear to resume classes".
The man was taken into custody at a nearby address, and he will be processed in due course.