At least 13 people have been killed and more than 20 wounded after a gunman opened fire in a school in Rio de Janeiro, Brazil.

The shooter, who is believed to be a 24-year-old former student at the school, also died in the massacre, although it is unclear whether he was killed by police or shot himself.

The gunman has been identified as Wellington Menezes Oliveira.

The tragedy occurred at the Escola Municipal Tasso da Silveira school in the western Realengo area.

The person entered, and fired shots, a spokeswoman for Rio's police force told Globo TV,

According to Globo, Oliveira came to the school and told officials he wanted to make a speech.

Brazil's Estadao newspaper reported that the killer had two revolvers and a lot of ammunition. When he opened fire he aimed at victims' heads.

Dorival Porto Rafael, a trash collector who was in the school at the time, told Globo: [The gunman] came into the class saying he was going to give a talk. He went to an eighth grade class, on the [ground floor], and without saying anything took out a pistol from his bag and started firing. The police arrived and he tried to go up to the next floor, but when he saw he was surrounded he shot himself in the head.”

A local resident, Rodrigo Alves Pereira, told the BBC he heard a lot of shots coming from inside the school. I went out and saw many children... coming out of the school. Some of them were covered in blood, shaken, asking for help. One was injured in the shoulder. They were desperate and crying.

They said that there was a man wearing a suit who was shooting at school kids in classrooms. He first went to a reading room, talked to teachers there, and then went on to two classrooms. This is a complete tragedy! We are all devastated.”

Rio police revealed that the gunman also carried a letter which stated his plans for committing suicide after the shooting rampage.

The mass murder is not believed to be connected in any way with Rio’s ongoing gang warfare problems.