Police say the gunman opened fire in a classroom before taking his own life.
A fire department spokesperson identified the shooter as Wellington Menezes de Oliveira, 24, believed to have been a former student at the school.
More than 10 pupils were also injured in the shooting, the BBC reports.
Brazilian President Dilma Rousseff wept when commenting on the incident during a speech to business leaders and requested a moment of silence for the victims, Reuters reports.