Rio de Janeiro schoolchildren flee gunman Reuters

At least 13 people have died after a gunman opened fire in a school in western Rio de Janeiro.

Some 20 people, including children, were wounded in the shooting at the school for students aged 10 to 15, the Associated Press reported.

The vice-mayor of western Rio said 13 people had died in the shooting at Tasso da Silveira school, although it was not clear if that figure was accurate or included the attacker. Edmar Teixeira said the gunman was a 24-year-old former student who pretended to be giving a speech to students before opening fire with two handguns. When police appeared at the scene the gunman shot himself dead, Teixeira said. He left behind a letter outlining his motives.

One witness told the Guardian he had seen between 15 and 20 children dead or seriously wounded.

"It is a massacre, a true massacre," said Roni de Macedo, a fireman who arrived on the scene shortly after the shooting began and dragged eight seriously injured children from the school.

"There is blood on the walls, blood on the chairs. There are 15 to 20 dead I think," said De Macedo, who was covered in blood. "I've never seen anything like this. It's like something in the United States."

Witnesses said the shooting began outside the school at around 8.30am when a man opened fire on two boys, shooting one in the head and one in the arm with what was said to be handgun.

He is said to have continued through the metal gates and up to a packed classroom on the second floor, opening fire on children aged between 11 and 13.

Hercilei Antunes, 44, a postman who lives opposite the school and has a daughter there, said: "I saw a load of injured kids, bleeding kids. I saw a dead guy inside. I heard more than 30 shots.

"I heard shots, shots, shots and more shots. I tried to go in but he shot more and I am not made of steel."

With police helicopters hovering overhead Yvonette Fernandes, 51, wept as she looked for her 12-year-old niece along with scores of other desperate family members. "Where is she? I want to know where she is."

Terrified parents rushed to the school and television images showed them crying and screaming for information about their children. Helicopters landed on a sports field next to the school to ferry the wounded to nearby hospitals.

The shooting began about 8:30am local time (12.30pm BST). Witnesses said police responded quickly and traded fire with the gunman.