Doria said the dead included two teachers and six students, and several more people had been hospitalized after sustaining injuries. He says authorities don't believe the two were former students.
The shooting happened at about 09:30 local time (12:30 GMT) when the students were in a break at the state school in Suzano, near São Paulo.
Police of that area is on high alert and two helicopters were dispatched to assist the cops.
Sao Paulo State Governor Joao Doria said four children and two members of staff were among the dead.
Seven people were killed - including five children - and at least 17 others were injured when two hooded teenagers burst into a Brazilian elementary school Wednesday and opened fire, according to reports.
Students gathered outside the school recounted harrowing attacks and seeing several bodies lying in pools of blood.
The motive for the shooting is not clear, police said.
Reader letter: Being vaccine-hesitant is a health threat
Health officials recommend you call ahead to make sure locations have the vaccinations and staffing available to immunize you. Measles is a highly contagious virus that lives in the nose and throat mucus of an infected person.
Horacio Pereira Nunes, a retiree whose house is next to the school, said he began hearing shots around 10 a.m. Investigators said they had a pact to die together in the attack although Globo TV, citing police, reported that Monteiro killed Castro, and then turned the pistol on himself. "I only left when the police arrived".
Police say they found a revolver, a bow and arrow and items that appeared to be explosives inside.
"A monstrosity and cowardness without equal", Bolsonaro wrote in a tweet expressing his sympathies for the families of the victims of Wednesday's attacks.
Latin America's most populous nation has the largest number of annual homicides in the world, but school shootings are rare.
Far-right President Jair Bolsonaro made relaxing gun control a cornerstone of his campaign past year.
Gun laws have been extremely strict in Brazil since 2003 when former leftist President Luiz Inacio Lula de Silva signed measures that prevented ordinary citizens from carrying guns.
"It's a very sad scene, the saddest thing I've seen in my entire life".