Ekurhuleni Metro Police arrested a Grade 11 pupil at Fumana High School in Katlehong after he allegedly attempted to stab fellow pupils.
The pupil faces charges of attempted murder, assault with the intent to commit grievous bodily harm and intimidation.
The 17-year-old, who cannot be named because he is a minor, is expected to appear in the Palm Ridge Magistrates Court soon.
Ekurhuleni Metro Police Department (EMPD) spokesperson, Chief Superintendent Wilfred Kgasago, told News24 that the teen chased after five fellow pupils on the school premises.
Fearing for their lives, the five pupils ran into the principal's office and locked themselves inside. The incident happened on Monday.
READ: Pupil, 17, allegedly stabs teacher to death over 'feeding' argument
Kgasago said one of the teachers called EMPD's Constable Mxolisi Kali, who was near the school.
Kali arrested the pupil.
Gauteng Department of Education spokesperson Steve Mabona promised to respond to the allegations after gathering more information.