BEIJING--An elementary school guard in China injured 39 people in a knife attack on Thursday with many children among the victims, a state office and media reported.

Two of the injured were severely hurt in the attack in the southwestern region of Guangxi, the county-level propaganda office said on its social media account. Others sustained light injuries and no one was critically hurt, it said.

The suspect, a 50-year-old man surnamed Li who worked as a guard at the school in the town of Wangfu, attacked at around 8:30 a.m. (0030 GMT), according to the Paper, a Shanghai-government backed newspaper.

Li was under control and the matter was being dealt with, the propaganda office said.

A parent who was near the scene of the attack told the Paper that many of the injured children were about 6 years old.

China has seen several attacks on schoolchildren in recent years, with eight children killed in a similar attack in Hubei province last year.

Gun ownership is banned in China and knives have come under stricter controls in recent years.