A male suspect was brought "under control" and the wounded students were taken to hospital, three of them seriously injured. The attack was in the Xicheng district of the capital, Beijing. The assailant was arrested and is being questioned.
A man was arrested after attacking students at a primary school in Beijing on Tuesday, according to a district government, in a rare act of violence against children in the Chinese capital.
Twenty children were wounded and were taken to hospital the Xicheng district government said in a post on its social media account.
Three of them suffered heavy injuries but their condition was stable, it said.
The Xicheng government did not give other details of the attack, but posts on social media said the children suffered knife wounds to the head.
About six police cars were parked outside a hospital near the school, according to a witness.
Police declined to comment by telephone when asked about the attack.
Violent crime is rare in China but there has been a series of knife and axe attacks in recent years, many targetting children.