The 18-year-old was taken to hospital in a serious condition
All the victims, including teaching staff, were sent to hospital but were not in a life-threatening condition, authorities in Cangwu County, Guangxi region, said.
The incident at the Wangfu Central Primary School happened at 8:30 am when children would normally arrive for class. The attacker, reportedly aged around 50, was "under control", the government said.
"37 students suffered mild injuries and two adults suffered more severe injuries. All of them were sent to a hospital for treatment, and none of their lives are in danger," it said.
Schools in the region had only reopened in May after being closed for months due to the coronavirus outbreak.
A number of schools in China have been hit by attacks in recent years, forcing authorities to step up security amid calls for more research into the root causes of such acts.
In November, a man climbed a kindergarten wall in southwest Yunnan province and sprayed people with a corrosive liquid, wounding 51 of them, mostly students.
Last September, eight schoolchildren died and two others were wounded in a "school-related criminal case" in the central Hubei province, with a 40-year-old man arrested.
A knife-wielding man killed two people and wounded two others at a primary school in central Hunan province in April last year.
In April 2018, a man killed nine middle school students as they were returning home, in one of the deadliest knife attacks seen in China in recent years.
A homemade explosive killed eight people and injured dozens outside a kindergarten in Jiangsu province in June 2017.
The 18-year-old was taken to hospital in a serious condition
The brothers, who say they are innocent, are accused of having formed an organised criminal network in early 2021 in Romania, as well as in the US and Britain
The left-handed batter scored 3369 runs in 136 one-day internationals and 2893 in 140 Twenty20 internationals — both Pakistan records
Food supplies were distributed to 80 households
On January 31, a heart was airlifted from Delhi to Chennai, paving the way for Ayesha Rashid's life-saving surgery
The online retailer, which is headquartered in Singapore, has said it has around 108 million monthly active users in the 27-nation EU
The baby girl named Rouh, meaning Soul, suffered respiratory problems and a weak immune system, a doctor at the Emirati Hospital in Rafah said
Specialised teams are currently managing the situation by cleaning up and removing the dead fish