Gov. Joao Doria said the two attackers, who entered the building and started shooting around 9:30 a.m. local time, were believed to be between 20 and 25 years old.
Marilene Gonçalves, a 51-year-old housewife who lives near the school, went outside when she heard gunshots and screams. More than 1,000 children aged between 11 and 15 attend classes there.
But school shootings are rare.
São Paulo state governor João Doria tweeted that the victims had been "cruelly murdered".More news: Kirsten Gillibrand defends handling of sexual harassment allegations
Sao Paulo Commander of Police Forces Marcelo Salles said that the gunmen used "at least one.38 caliber pistol, along with homemade bombs and a crossbow" in an attack that was an "unspeakably brutal crime".
Wednesday's shooting happened in a public school in Suzano, a suburb of Sao Paulo, Brazil's largest city.
Brazil is one of the most violent countries in the world with 64,000 murders in 2017, a rate of nearly 31 per 100,000 inhabitants - that's three times higher than the level the United Nations classifies as endemic violence.
While gun laws are extremely strict in Brazil, it is not hard to illegally purchase a weapon. 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.More news: Spotify Hits Apple With Antitrust Complaint in Europe Over App Store
Website UO1 said the two killers, "probably teenagers, entered the school shooting with their heads covered by a hood".
The attack comes after Brazilian President Jair Bolsonaro announced that the country's gun ownership controls would be eased.
After shooting at students in the yard, the killers "headed to the language center" where several pupils were hiding and "committed suicide in a corridor", added Sales.
Police say they found a revolver, a bow and arrow and items that appeared to be explosives inside.More news: YouTube Music Launches in India: Everything You Need to Know
"It's a very sad scene, the saddest thing I've seen in my entire life".
- Facebook, Whatsapp and Instagram are down for many
- Ethiopian Airlines crash: Six charts on what we know so far
- North Korea election sees 99.99% turnout - KCNA
- New Zealand calls for vaccination against measles following outbreak
- Collins to Redskins for 6 years, $84M
- India to clash with Australia in 5th ODI on March 13
- Nancy Pelosi says impeaching Donald Trump 'just not worth it'
- Chrome 73 finally supports dark mode on Mac
- #Trashtag: the eco-conscious social media challenge that's gone viral
- Brexit hangs in balance over tweaked deal