Qin Pengan stabbed the children with a kitchen knife allegedly in retaliation for his life not going to plan and over a dispute with a neighbour, Xinhua reported.
None of the children died from their injuries, but four were seriously wounded. Qin fled the scene and later surrendered to police.
A local court in Pingxiang city in south China’s Guangxi province sentenced Qin to death, and the sentence was carried out on Friday after being approved by China’s Supreme People’s Court, the agency said.
The Supreme People’s Court said his behaviour constituted the crime of intentional homicide and even though the attempted murder failed and he turned himself in, it was not enough to warrant a more lenient sentence.
Violent crime is rare in China but there has been a series of knife and axe attacks in recent years, many targeting children.
In October, a woman injured 14 children in a knife rampage at a school in the city of Chongqing.
Despite efforts to reduce the number of people executed every year, China still puts more people to death every year than any other country, according to estimates from human rights groups.
While there are no official figures, thousands are thought to be executed each year in China, according to Amnesty International.
In December, a Supreme People’s Court judge made a rare defence of the death penalty, saying China could not abolish the system for fear of angering a public that overwhelmingly supports its use.
More about: China