But the lawyer for the tribunal's complaints assessment committee Kate Lawson-Bradshaw said the teacher should be censured for serious misconduct because there was no imminent threat that either the boys or anyone else would be hurt.
The case is seen as a test of new rules on physical restraint issued to schools in 2016.
Names of the teacher, students and the school are all suppressed at least until the tribunal issues its decision.
The teacher told the tribunal that one of the boys, Student B, had recently been transferred from another residential facility with instructions to the school's staff that he must not be allowed to contact certain people he knew in the city.
The other boy, Student A, had a history of "getting into situations where his own safety was at risk and where he put others at risk".
"He had actually returned from weekends so badly bruised in the face that I had him checked by the doctor because I suspected a broken eye socket," the teacher said.
"He absconded at weekends from his home and connected with local street kids.
"Although I did attempt to restrain him so that he couldn't abscond, my main concern was for the child that he was attempting to get to [another part of the city]. To be perfectly honest about it, Student A was prospecting Student B, being from a gang background."
He said the school tried to prevent Student A from taking Student B out of the school by sending Student A home for the weekend one day early.
But Student A misinterpreted this as a decision to expel him, and ran to look for Student B saying he intended to take the boy with him.
The teacher said he tried to "de-escalate" the situation by coaxing Student A into his classroom, telling him that Student B would be there.
But when Student A got to the classroom and found it empty, he attempted to run and the teacher tried to restrain him.
The teacher said he tried to use a technique of Safe Crisis Management known as Upper Torso Assist.
But Paul Kennedy, who introduced Safe Crisis Management to New Zealand and trained teachers at the school in the techniques, said Upper Torso Assist required putting both hands around a person.
In this case, closed-circuit video footage of the incident, which was shown repeatedly in slow motion at the hearing, showed that the teacher held an iPad in one hand and a pen in the other throughout the incident.
Lawson-Bradshaw said the teacher should not have intervened physically at all because teachers were subject to the same law as other civilians, under which it is illegal to use violence except in self-defence or to prevent "imminent" harm to someone else.
"There was no justification for any form of restraint," she said. "There was really no other way to characterise this conduct but as serious misconduct."
Tribunal chairwoman Theodora Baker said the tribunal would issue a written decision in the next few weeks.