The attackers appeared to be in their early to mid-20s, and authorities don't believe they were former students, the governor said.
Around 15 others were injured in the shooting, which took place at the Raul Brasil public school in Suzano, on the outskirts of Sao Paulo in southeast Brazil.
About 1,000 children attend the school, police said.
"The school is on lockdown", he said.
The attack comes after Brazilian President Jair Bolsonaro announced that the country's gun ownership controls would be eased.
Google just released the first Android Q beta
Coming to the Pixel phones , the original Pixel smartphones have already received the promised 2-year Android OS updates. Controlling apps that access photos, videos and audio files have become easier to manage on Android Q.
"Then a lot of kids started running out, all screaming", he said.
Despite strict weapon laws, gun crime is rampant in Brazil, yet school shootings are a rare occurrence. The gunmen took their own lives, officials said.
Security cameras from homes near the school showed children jumping over a white wall that surrounds the Raul Brasil building and sprinting down streets, screaming for help.
The gunmen were wearing masks and killed themselves after the attack, police said. The last major incident of this type occurred back in 2011, when 12 schoolchildren were shot dead in Rio de Janeiro by a former student.
Crime scene photographs released by police show Monteiro, his head lying in a pool of blood, dressed in black with a machete tucked in his trousers. Castro's body lay near Monteiro's, with the crossbow on the ground between the pair.
Five students, a teacher, and an administrator at the school were killed, said Joao Camilo Pires de Campos, the state's public secretary. "It is the saddest thing I have seen in my life".