File picture: Pixabay

Shanghai — A 29-year-old man using a kitchen knife attacked three boys and a mother near a school in Shanghai on Thursday, killing two of the children, police said.

The suspect carried out the attack around 11:30 a.m. and was caught by police with the help of passers-by, the Xuhui district public security office said in a notice on its official Sina Weibo microblog page. Two of the boys died at the hospital.

Another boy and the woman survived and did not have life-threatening injuries.

Police said the man, surnamed Huang, had arrived in Shanghai earlier this month and was unemployed. It said he carried out the attack "to take revenge on society." The man could not be reached for comment.

Because Chinese law tightly restricts the sale and possession of firearms, mass attacks are generally carried out with knives or homemade explosives.

Perpetrators of similar attacks in the past have been described as mentally ill or bearing grudges against society.

Many of those incidents have occurred at schools, included several in 2010 in which nearly 20 children were killed, prompting a response from top government officials and leading many schools to beef up security.

AP