A knife-wielding man attacked students and parents at the gates of a Shanghai school on Wednesday, China Central Television reported.

Authorities reportedly said the assailant went on the rampage after killing two women in a home nearby.

Police were called to Jinhui Primary School in the suburban Fengxian district at about 5 pm, CCTV said.

Xinhua News Agency reported that 11 people were wounded, including six children. None of the injuries were thought to be life-threatening.

A suspect, identified only as Zang, was detained at the scene, according to a police statement released at 7 pm.

The statement said Zang arrived in Shanghai from neighboring Jiangsu province on Tuesday and had killed two female relatives staying near Fengxian's Jinqian highway on Wednesday afternoon.

Authorities have reportedly blamed the killings on a family dispute.