Image copyright EPA Image caption Local citizens turned out to give blood after the incident

Nine students have been stabbed to death and 10 injured in a knife attack outside a school in northern China, officials say.

A man suspected of carrying out the attack is alleged to be a former student taking revenge for having been bullied at the school.

The assault took place near Mizhi County Number Three secondary school in Shaanxi province as the students were heading home for the day.

The suspect remains in custody.

Chinese police have given his surname as Zhao and say he is 28.

Their preliminary assessment is that he was motivated to take revenge because he was bullied in his third year (where students are typically aged 13-14).

Police say the dead are seven girls and two boys.

Photos on social media showed several young students lying on the ground in Yulin city, surrounded by shocked onlookers.

The attack happened at the school at around 18:10 local time (10:10 GMT) on Friday, a local government statement said.

The injured children are receiving treatment in hospital.

Their exact ages have not been given but reports suggest they may be middle school children, which would make them aged 12 to 15.

Knife attacks have made the headlines in China in recent years:

A spate of unconnected stabbings at schools between 2010 and 2012 left at least 25 dead and more than 100 injured

The country executed three men in March 2015 after they were found guilty of a savage knife attack at Kunming station, where 29 people were hacked to death and more than 100 others wounded. The trio had been convicted of murder and terrorism offences

In July 2017, two people died and nine were injured by a knife-wielding man at a Wal-Mart supermarket in the southern city of Shenzhen