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.
Violent crime is rare in China compared with many other countries, especially in major cities where security is tight, but there has been a series of knife and axe attacks in recent years, many targeting children.
In April, a 28-year-old man who harbored a hatred of children having been bullied at school stabbed to death seven Chinese middle school students who were on their way from classes in the northwestern province of Shaanxi.
Such attacks are often blamed on people with mental illness or who have personal grievances. Knives are most commonly used because gun controls are extremely strict in China.