The suspects are believed to be two teenagers, who shot themselves after the rampage.
The identities of the victims and the alleged attackers - who were said to be former students at the school aged between 20 and 25 - have not yet been released.
At least 17 more students were injured in the shooting and taken to nearby hospitals.
He said it was not yet known whether the assailants were former pupils at the school.
By midday Wednesday, officials confirmed 10 people were killed.
Sao Paulo´s state military police department told AFP that "several people were shot" when "an individual" entered the institution in Suzano and opened fire. 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.
Brazil, the biggest nation in Latin America, has the largest number of homicide deaths in the world each year.
Students gathered outside the school recounted harrowing attacks and seeing several bodies lying in pools of blood.
Marcelo Salles, commander of police forces in Sao Paulo state, spoke just outside the school and said that in his over three decades of service, he had "never seen anything like this, it was an unspeakably brutal crime".
Far right President Jair Bolsonaro passed a law allowing people to carry arms soon after assuming power in January, delivering on a campaign promise.
Security cameras from homes near the school showed children climbing and jumping over a wall that surrounds the Raul Brasil building, and sprinting down streets, screaming for help.
Five students, a teacher, and an administrator at the school were killed, said Joao Camilo Pires de Campos, the state's public secretary.