At least 17 more students were injured in the shooting and taken to nearby hospitals.
Salles said the gunmen used at least one.38 caliber pistol and speed loaders, along with a crossbow and a compound bow and arrow.
Sao Paulo governor Joao Doria said on Twitter the "children were cruelly murdered".
The assailants reportedly were former students of the school, yet the motive of the attack remains unclear.
"We stayed there until the door was opened".
Doria said the school had been evacuated and police were inspecting possible explosives left by the shooters.
Police said the two men, who they did not believe were former students at the school, entered the building and started shooting at about 9:30 a.m. local time.
"I heard a lot of screaming", she said. "It didn't take long until police arrived".
The public school, Raul Brasil Professor, has more than 1,600 students from elementary to high school grades, teachers gathered outside said.
School shootings are rare in Brazil, even though the country is one of the world's most violent, with more annual homicides than any other.
Far-right President Jair Bolsonaro made relaxing gun control a cornerstone of his campaign previous year. Soon after being inaugurated January 1, Bolsonaro issued a decree making it easier for people wanting a gun to buy and possess one.
Sen. Major Olimpio, a member of Bolsonaro's party and a proponent of loosening gun legislation, again made that argument hours after Wednesday's rampage.
The wounded student who took shelter in her house could not speak.