He killed eight fellow students and a school guard on Wednesday before being arrested.
A father of a student at the school in central Belgrade said the shooter entered his daughter’s classroom, firing at her teacher and then her classmates as they ducked under their desks.
Most students were able to flee through a back door, according to a local official.
Senior police official Veselin Milic said the shooter drew sketches of classrooms and wrote a list of children he planned to “liquidate” in an attack he planned for a month.
Milic said Kosta Kecmanovic called police himself when the attack was over.
Earlier, police said Kecmanovic was a student at the Vladislav Ribnikar school and was born in 2009. They said he used his father’s gun.
Six more children and a teacher were also hospitalised in the attack.
Local media footage showed a commotion as police removed Kecmanovic, whose head was covered as officers led him to a car.
Police sealed off the blocks around Vladislav Ribnikar, which is what’s known locally as a primary school, whose students would typically range in age from six to 15. Authorities later carried body bags to a waiting van.
Experts, however, have repeatedly warned of the danger posed by the large number of weapons in the country after the wars of the 1990s.
They also note that decades of instability stemming from the conflicts as well as the ongoing economic hardship could trigger such outbursts.
Police said they received a call about the shooting at about 8.40am (4.40pm AEST) on the first day classes resumed after a long weekend for the May 1 holiday.
“I was able to hear the shooting. It was nonstop,” said a student who was in a sports class when gunfire erupted elsewhere in the building.
Her mother asked that her name be withheld because of her age.
“I didn’t know what was happening. We were receiving some messages on the phone,” the student said.
She described the suspect as a “quiet guy” who had good grades.
“He was not so open with everybody. Surely I wasn’t expecting this to happen,” she said.
Milan Nedeljkovic, the mayor of the Belgrade area of Vracar, where the shooting happened, said most of the students were taken out a back door of the school.
“We have video surveillance, but now this is a lesson, we need metal detectors too,” he said.
“It is a huge tragedy … something like this (happening) in Belgrade. Such a tragedy at an elementary school.”
Four students and a teacher were sent to University hospital, according to the hospital’s director, who said one child and the teacher were in serious condition.
Milan Milosevic, who said his daughter was in a history class when the shooting took place, told N1 television that he rushed to the school when he heard what had happened.
IN PICTURES: The deadliest mass shootings in US history