Beijing, China (CNN) -- A court in eastern China sentenced a man to death Saturday for attacking 29 kindergarten students and three teachers with a knife, state-run media said.
The Taixing Intermediate People's Court found Xu Yuyuan, 47, guilty of intentional homicide after a half-day trial, Xinhua news agency said.
Xu told the court that his rage against society motivated him in the April 29 attacks, according to Xinhua. But he appealed the death sentence, arguing that the punishment was too severe since no one died in the attacks, Xinhua said.
Chinese penal code says a person can be convicted of intentional homicide for acting on an intent to kill, the news agency reported.
A police probe found Xu had been unemployed since 2001, when he was fired by a local insurance company. He told police he carried out the attack because he was angry about a series of business and personal humiliations, Xinhua said.
About 300 people attended Saturday's open trial, according to Xinhua.
Xu's sentence was the second death penalty conviction after a recent spate of school attacks that have prompted public outrage across China.
Zheng Minsheng, 42, was sentenced to death and executed on April 28 for attacking students in front of an elementary school in Fujian province, killing eight and wounding several others. Zheng also used a knife in the attacks, Xinhua reported.
Authorities said Zheng carried out the attack because he was frustrated at "failures in his romantic life," the news agency said.
At least four other such attacks on school children in China have been reported since March.
Guns are strictly regulated in China, but until recently large knives were not. Chinese authorities have recently issued a regulation requiring people to register with their national ID cards when they buy knives longer that 15 centimeters.
Other measures have been put in place.
In April, the Ministry of Education ordered kindergartens, elementary and secondary schools to restrict strangers from entering the campuses. The ministry instructed schools across the country to hire security guards, install security facilities and ensure that pupils were escorted home. Schools were also urged to teach pupils to how to protect themselves.
In some schools, security guards have been armed with "forks," long poles with semi-circular prongs that can be used to fight assailants.