A Chinese city has ordered police to shoot to kill anyone attempting to harm school students following a spate of violent attacks against children that have stunned the nation, state press said.

The south-west municipality of Chongqing, a city of more than 30 million people, issued the order after China's public security ministry called for stepped-up security around schools and kindergartens nationwide.

"The police have clear regulations in these odious cases where direct attacks occurring at or in the vicinity of schools have injured students or children," the Chongqing Evening News reported.

"If they cannot contain the violent acts, police can shoot to kill in accordance with the law."

The order comes after a series of attacks on children last week.

On Friday, a farmer armed with a hammer injured five children and a teacher at a primary school in the eastern province of Shandong before setting himself on fire.

A day earlier, a jobless man, apparently angry over a series of personal and professional setbacks, slashed 29 children and three adults at a kindergarten in the eastern city of Taixing armed with a knife used for slaughtering pigs.

That attack came two days after a 33-year-old teacher placed on sick leave for mental problems injured 15 students and a teacher in a knife attack at a primary school in southern China's Guangdong province.

On that same day authorities in Fujian province in the south-east executed a former doctor for stabbing to death eight children and injuring five others in March in a fit of rage after he broke up with his girlfriend.

The attacks underscore how China, which has enjoyed lower violent crime rates than the West, faces a growing public safety threat from disgruntled individuals amid rising mental illness rates and looser social controls.

- AFP