City of Ekurhuleni disaster and emergency management services spokesperson William Ntladi said a second school learner was hospitalised for shock while two others were treated and discharged.
Ntladi said two men were being chased by police for a crime committed outside the school in Edenvale on Wednesday.
“They managed to jump over the school-perimeter fencing and started shooting randomly, hence the pupil was struck by a stray bullet that broke through the window (in the classroom on the first floor).
"(The) 18-year-old boy sustained upper-body gunshot wounds. One was an entrance and exit wound through the upper-right chest while the second wound was on the upper-right arm where the bullet was stuck in the flesh.
Ntladi added that the suspects were arrested on the scene. Another was still being sought.
The school official, who asked not to be named, said she was informed that the men had entered the school’s premises, and when security guards realised one was carrying a gun, they started chasing him.
“They then started firing randomly. A learner who was in class at the time was hit,” said the official.
Gauteng provincial police spokesperson Captain Mavela Masondo said: “At this stage, we are investigating who and where the shot was fired from. The bullet came through the window and hit the learner.
"There is one bullet hole in the window,” Masondo said.
He added that a case of attempted murder was being investigated.
The employee said learners were released early from school after the incident.
“They are traumatised. We do not know whether normal schooling will take place tomorrow or not,” the employee added.
Education spokesperson Steve Mabona said: “All learners have been accounted for. Our psychosocial team is providing the necessary support and counselling to the school.”