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.
Son’s ‘sad’ tweet boosts business for dad’s new doughnut shop
After the successful day, By changed his own Twitter profile to "Billy's Donuts". "This means so much to my family", he tweeted. On Sunday, Billy wrote on Twitter that the shop had completely sold out of donuts and kolaches.
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".