The government said the suspect had been apprehended at the scene and an investigation has been launched.
A tweet by the Global Times said a hammer was used to carry out the assault.
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.
Parents escort their children outside the gates of elementary school in Beijing.
A video posted on social media showed parents being told by staff that the perpetrator was believed to be a "school worker", the South China Morning Post reported.
The incident happened at around 11:15am local in the city's Xicheng district, police said.
Jia was a migrant worker from Heilongjiang province whose contract had ended at the start of the year, and police suspect that the attack was motivated by anger at having his employment terminated.
NG HAN GUAN APParents wait outside the entrance to the Beijing No. 1 Affiliated Elementary School of Xuanwu Normal School in Beijing China
The school, founded in 1908, has 2,537 students and 199 teaching personnel, according to its website.
Violent crime is rare in China but there has been a series of knife and ax attacks in recent years, many targeting children.
Though the school was discussing another job posting for Jia, he used a hammer and attacked students to "vent his resentment", they said.
In 2010, almost 20 children were killed in knife attacks outside school gates.
All the injured children were receiving hospital treatment.
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 November 2018, five people were killed when a vehicle was driven into a crowd of children outside a kindergarten in the northeast of the country.
Josh McDaniels confirms he will be back with Patriots in 2019
McDaniels spurning the Colts last off-season likely was a main reason in the Browns not asking to interview him. Like I said, the past few days have been absolutely out of control for the former Texas Tech coach.
Aaron Ramsey pens pre-contract agreement with Juventus ahead of summer move
Ramsey joined from hometown club Cardiff as a youngster and has won three FA Cups in his time at the North London club. Kean leaving? No, we'll try to keep all the players that are here.
Talk hope, Job data and dovish Fed boosts equities on Friday
Another Dow-member Intel also rose in response to an upgrade from Bank of America Merrill Lynch to buy from neutral. The Labor Department reported on Friday that 312,000 jobs were created last month, well above market expectations.