A total of seven children and two adults have been killed in a school in the Russian city of Kazan, officials say.
Those injured mostly children was twenty-one and a 19-year-old suspect has been detained.
Russian PM Mikhail Mishustin spoke of “great sorrow” while Tatarstan’s leader Rustam Minnikhanov described the attack as a “major tragedy”.
“We are deeply saddened that this has happened,” he said.
Responding to the shooting, Russian President Vladimir Putin said he would review the country’s gun control laws.
Mr Minnikhanov confirmed the deaths of seven children – four boys and three girls – as well as a female teacher and a female school worker at School No 175. It is believed the children were eighth graders (aged around 15).
Eighteen children and three adults were being treated in hospitals for gunshot wounds, fractures and bruising, Mr Minnikhanov added.
The attack is said to have begun at about 09:20 local time, a source in the emergency services told Russian news agency Tass. The first signal from a panic button at the school was sent five minutes later.
“Everyone started panicking and saying ‘shut the doors’,” a student who witnessed the attack told the Mediazona news website. “About a minute later the head teacher started yelling: ‘We’re shutting the doors!’
“We got out about 15 minutes later, not out of the windows. I wanted to do that, but the teacher closed the window immediately and said no.”
Footage shared on social media shows some children jumping from windows to escape as well as injured people being evacuated. Russian TV reported that two of the children had died after jumping from a second-floor window.Heavily armed police and emergency vehicles responded to the incident.
A Kazan resident outside the school told Moscow Echo radio station that people there were hysterical. “Parents are crying, medics are giving out medicine,” she said.
Elvira Ignatyeva, a 25-year-old English teacher, was killed trying to shield one of the children, a police source told Tass news agency, quoting eyewitnesses.
She had pushed the child out of the way in a corridor and tried to block the gunman but was shot and mortally wounded, the source said.
What we know about the suspect
But officials later said there was only one suspect, named locally as Ilnaz Galyaviev.
Russian investigators say he is a Kazan resident and it is believed he once studied at the school.
Mr Minnikhanov said the suspect was a registered firearm owner. According to Russian MP Alexander Khinshteyn, the suspect received a firearms licence only recently. The MP said it was for a semi-automatic shotgun.
The suspect went on social media before the attack, posting that he planned to kill a “huge number” of people before shooting himself. Screenshots of his account, now blocked, show him wearing a black mask with the word “god” written across it in red.
A video on social media captured a teenager lying on the ground apparently being detained outside the building.