The suspect was apprehended at the scene and an investigation has been launched, the statement said.
A tweet by the Global Times said a hammer was used to carry out the assault.
In video footage, which showed dozens of angry parents demanding details from staff, they were repeatedly urged to stop filming by the head teacher.
A Reuters witness described seeing six police cars outside the school where the attack took place.
The primary school, Beijing No. 1 Affiliated Elementary School of Xuanwu Normal School, was founded in 1908.
A report by the Press Association alleged that the 49 year male attacker, Jia, from northern Heilongjiang province, was employed through a labour service company to carry out maintenance work at the school. The injured children have been hospitalised.
Accounts of what weapon was used have varied, with some parents claiming on social media that a hammer was used, while others reported a knife.
LG unveils incredible 65-inch "roll-away" 4K TV
The LG Signature OLED TV R has three different viewing options: Full View , Line View , and Zero View . Plus, with AirPlay 2, users can play videos from other Apple devices and access iTunes.
Outside the school gates Tuesday afternoon, parents who were there to pick up their kids said they had received little information about the attack.
A doctor at the hospital posted on social media: "The mayor today came to the hospital to wait with us while the children were being medically treated".
Violent crime is rare in China but there has been a series of knife and ax attacks in recent years, many targeting children.
It comes just months after a 39-year-old woman was reportedly held on suspicion of stabbing 14 school children in October last year in Chongqing.
In January 2017, a farmer armed with a kitchen knife wounded 12 children at a kindergarten in southern Guangxi Zhuang autonomous region.