One of the shooters also killed his uncle, owner of a nearby used-car dealership, shortly before carrying out the massacre at the Raul Brasil state school in the city of Suzano, on the outskirts of Brazil's largest city.
Four individuals were still being treated in state hospitals, a spokesman for the Sao Paulo health ministry told the AP Monday.
The attackers were identified as 17-year-old Guilherme Taucci Monteiro and 25-year-old Henrique de Castro. Authorities were also looking into the possibility of a third accomplice.
The tragedy revived a debate around loosening gun laws in the country, a key campaign promise of far-right President Jair Bolsonaro.
Brazil is the world leader in annual homicides but school shootings are rare. According to a study by the Instituto Sou da Paz, Brazil has had at least seven other similar shootings since 2002, killing a total of 28 people and injuring 41 others.
The study found that in half of the cases, the guns used were legally obtained arms.
The investigation into this latest shooting is still ongoing and authorities have not yet said where or how the attackers had acquired the gun and other weapons used.
- AP