A teacher in the Mpumalanga province in South Africa has been suspended after video surfaced of him allegedly monitoring a high school exam with a gun in his hand.

The incident occurred on June 4 at Mabusabesala Secondary School, in the town of Weltevrede, according to local media reports. Eleventh graders in the classroom were writing an exam essay on tourism.

A video of the incident was released by the Mpumalanga Department of Education, according to News24, a South African news site. It was then posted on Twitter on June 7 by user @SpheDludla and has since been viewed nearly 70,000 times.

"The department views this in a serious light and has already instituted an investigation to understand the circumstances that led to this conduct,” said Jasper Zwane, a department spokesman.

The department is offering counseling to students on Monday and has “directed” the school to open a case with the police, Zwane added.

Some Twitter users expressed sympathy with the teacher, saying that the job came with risks. “I’ll never be a teacher in a South African school without a gun,” one wrote. “I’m terrified of guns but I don’t blame him shame,” another wrote. “Being a teacher has become more risky than being a police [sic].”

Schools in South Africa have seen a spate of violent attacks on students in recent months. At least two teenagers were stabbed to death by fellow classmates in June, and four others have been stabbed since the beginning of the year, according to News 24. A 2016 study by the Centre for Justice and Crime Prevention, a Cape Town-based nonprofit, found that more than a fifth of high school students had experience threats of violence, assaults, robberies or sexual assaults at school between 2011 and 2012.