Three of the children have serious but non-life-threatening injuries after the attack, which took place on Tuesday at around 11:20am.
Chinese authorities say a male attacker has wounded 20 children inside a Beijing primary school.
Police in the Xicheng district of the city said in a statement on Weibo that they had detained a 49-year-old male suspect surnamed Jia, who was a former fix worker at the school.
A native of northern Heilongjiang province, Jia was employed through a labour service company to perform daily maintenance work at the school.
"People who hurt children do not deserved to be forgiven", a social media user wrote in a post on Weibo, a Twitter-like microblog.
In 2010, almost 20 children were killed in knife attacks outside school gates.
A tweet by the Global Times said a hammer was used to carry out the assault. All the children are receiving hospital treatment.
Some parents claimed on social media that around 20 children had been injured, although there were conflicting reports about whether a hammer or a knife had been used in the attack. Another video shows anxious parents forming a large crowd outside the school's entrance, demanding details.
About six police cars were parked outside a hospital near the school, according to a Reuters witness.
Police in Xicheng, a major district of Beijing, declined to comment when reached by phone.
Violent crime is rare in China but there have been a series of knife and axe attacks in recent years, many targeting children.
Earlier in April, nine schoolchildren were killed by a man who went on a knife spree at a school in Shaanxi province, and another two were stabbed to death outside a Shanghai kindergarten in June.
In 2017, a man in his 40s injured 12 children with a vegetable knife during a rampage in the southern city of Pingxiang.
- World Bank President Jim Yong Kim Resigns Before End of Term
- PG&E shares plunge on bankruptcy worries
- Apple Is The Star Of CES 2019 and They’re Not Even Here
- Trump plans televised address, visit to Mexico border
- Eagles beat Bears 16-15
- Job growth surges, unemployment ticks up. Why?
- Disneyland set to increase prices, again
- Jurgen Klopp requested about January transfers - Liverpool followers WON'T like the reply
- Don Lemon breaks down why Kevin Hart's 'apology' just doesn't cut it
- Hulk Hogan Returning To ‘WWE Raw’ To Honour ‘Mean’ Gene Okerlund