A teenager has killed eight people and wounded five others in a knife attack in China's Liaoning province, state media says.

The attack happened late on Wednesday in Yongling township, a Xinhua report said.

Those killed included two relatives of the suspect's girlfriend and six other people, the report said. The injured were receiving treatment, it added.

The suspect was detained by police at the scene.

State media said the 17-year-old killed two of his girlfriend's relatives "after having conflicts" with his girlfriend.

He killed the other six people "while fleeing the scene", it said.

No other details were immediately available.

Violent crime has been in the spotlight in China since a string of incidents in 2010 involving lone individuals targeting children in apparently random attacks.