Rio de Janeiro state health department chief Sergio Cortes revised the toll down from the 13 dead and 22 wounded announced earlier by fire officials in the chaotic few hours after the attack.
Authorities identified the shooter as 24-year-old Wellington Menezes de Oliveira, a former student at the public school, and who had no prior criminal record.
Police said he left a letter saying he was infected with AIDS and wanted to commit suicide, but they also said he appeared to have prepared for a major deadly assault, bringing into the school two revolvers and loads of ammunition just as students and staff were arriving at the morning bell.
Education Minister Fernando Haddad described the attack as "an unprecedented tragedy in Brazil," adding that "this is a day of mourning for all Brazilian education."
Colonel Evandro Bezerra, a fire department spokesman, told TV Globo News several of the dead and wounded had been shot in the head. A local hospital treating most of the wounded called for people to donate blood.
While violence plagues several South American countries, attacks on schools are rare. A similar shooting at a school occurred in Argentina in September 2004, when a 15-year-old student shot dead three classmates and wounded five others.
The three-storey school in Rio's Realengo district where Thursday's shooting occurred served hundreds of children between nine and 14 years old.
Menezes de Oliveira "came to the school prepared to do what he did," Bezerra said.
"Employees of the school told officers that the young man arrived well-dressed and carrying a backpack, and said he told them he had been invited to speak with students in a school conference," Bezerra said.
"That's how he gained access to the third floor," where he launched his attack on at least one classroom, sending terrified students running out of the building.
Seventh-grader Pamela Cristina Ferreira was one of those who escaped, and encapsulated the fear that rippled through her classmates and the broader community.
"I'm scared to go back to school," 13-year-old Pamela told AFP, after losing her friend Larissa and nine other fellow students.
Pamela was on the third floor when she heard crackling gunfire, then raced down the stairs to the auditorium with fellow students.
"We blocked the auditorium doors with barricades," she added. "We were all in a panic, but we calmed down when we saw the police."
Military Police Colonel Djalma Beltrame said police stormed the school and wounded the attacker, "but the man killed himself with a gunshot to the head."
The gunman left a rambling suicide note that seemed "the words of a delusional person... someone with no love of life," Bezerra said.
Beltrame said police were fortunate that a patrol was driving past the school at the time of the shooting.
"If the police did not arrive as quickly as they did the tragedy could have been far worse, because this man had a lot of ammunition and was carrying two guns," Beltrame said.
Rousseff's voice broke as she discussed the tragedy.
"It's not common for this country to see such a crime," she added. "We stand united in repudiating this kind of violence."
The president also called for a minute of silence, "so that we may pay our respects to these little Brazilians whose lives were taken away prematurely."
Hundreds of distraught parents and neighbors rushed to the school for word of loved ones, with some fainting amid scenes of despair outside the building.
Eluzia, who lives opposite the school, told AFP that her 10-year-old son was lucky to escape the bloodbath.
"I saw many more people running, people who had been shot. It was horrible," Eluzia said.
"This neighborhood is very calm, I never imagined that something like this could happen here."