The 29-year-old man attacked three school children and a parent with a vegetable knife around 11:30 a.m. [03:30 GMT], the Shanghai police said in a statement.
The victims have been taken to a hospital, two school kids died while a third and a parent are not in a life-threatening condition, the police noted.
#BREAKING: At least two students were killed and one injured in a knife attack outside gate of primary school in Shanghai Thursday morning. The attacker was later detained, according to local media. pic.twitter.com/Jp1ngizwi3
— China News 中国新闻网 (@Echinanews) 28 июня 2018 г.
READ MORE: Man Attacks School Students in China, at Least 7 Dead and 12 Wounded (PHOTO)
Violent crimes are often blamed on people with mental illness or who have personal grievances.
Knives are most commonly used in such attacks because gun control is extremely severe in China.