The shooting happened at the Professor Raul Brasil school in Suzano, a satellite city of São Paulo, at about 09:30 local time (12:30 GMT) when the students were on a break at the state school.
The gunmen killed 8 people and injured at least nine other students. Of the 8 killed, 5 were about 15 years old. Two school employees and the owner of a nearby car rental shop – from whom the attackers stole a car – also died. The gunmen shot the car rental owner on their way to the school.
After the rampage, the gunmen, aged 17 and 25, both killed themselves.
It has now been revealed that the gunmen were former pupils of the school, officials say.
It is not yet known why the former pupils attacked the school.
The São Paulo governor, João Doria, said after visiting the school: “It’s the saddest scene I’ve witnessed in my whole life.”
João Doria declared three days of mourning following the attack.
Narrating how the attack unfolded, Marcelo Salles, commander of police forces in São Paulo, said the gunmen entered the school and shot dead co-ordinator Marilena Ferreira Umezo, 59, before killing another employee. They then killed and fatally wounded five students and injured several others before killing themselves in a hallway.
The attackers wore masks during the attack and were armed with a handgun outfitted with an automatic reloader, a crossbow, a hatchet and fake explosives, the police said.
Only secondary students were at the school at the time of the shooting. Police arrived eight minutes after being called and did not confront the gunmen.