SHANGHAI : A man stabbed two boys to death outside a Shanghai elementary school on Thursday, police said, the latest in a series of similar attacks in China in recent years.

Officers took the unemployed 29-year-old suspect into custody with the help of bystanders after three boys and a mother were attacked with a kitchen knife around midday, according to a police statement. Unverified videos circulating online showed two boys with neck wounds lying in pools of blood on a pavement as two women attempted first aid.

State broadcaster CCTV said the incident happened outside a campus of the Shanghai World Foreign Language Primary School, a top private institution that accepts both Chinese and international students.

Police said the third boy and the mother also attacked did not suffer life-threatening injuries, the police said. The suspect told police he had no income after moving to Shanghai at the beginning of the month and wanted to take “revenge on society”, the statement said.

China has seen as raft of knife attacks in recent years, with several children among the victims.

In April, a 28-year-old man who claimed he had been bullied by classmates as a child stabbed to death nine middle school children and injured 10 others in northern China.

In January 2017, a man armed with a kitchen knife stabbed and wounded 11 children at a kindergarten in China’s southern Guangxi Zhuang autonomous region.