Seven children and two adults have been killed in a shooting at a school in the Russian city of Kazan, officials say.
Twenty-one other people, mostly children, were injured. A 19-year-old suspect was detained.
The attack happened in the capital of the republic of Tatarstan, 820km (510 miles) east of Moscow.
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.
School shootings are relatively rare in Russia. One of the last major incidents happened in Russian-annexed Crimea in 2018.
How did the attack unfold?
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 began at about 09:20 local time (06:20 GMT), 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.
What do we know about the victims?
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.
On her Instagram account, Ms Ignatyeva had often posted upbeat messages over photos of herself enjoying walks and nights out.
"It's not that hard to make your life happy," she wrote on 1 February. You just need to stop thinking that happiness is only possible somewhere over there, in the future, and learn to enjoy every actual minute, here and now..."
What do we know about the suspect?
Reports initially said that there were two gunmen and that one of them had been killed. 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.
Officials did not comment on the possible motive for the attack although Mr Minnikhanov called the attacker a "terrorist".
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.
Задержание одного из нападавших. Видео: Readovka pic.twitter.com/GsQmBFvTIM— МБХ медиа (@MBKhMedia) May 11, 2021
What has the reaction been?
Authorities have called for all schools in Tatarstan to be inspected and have their security stepped up.
A day of mourning will be held on Wednesday to honour the victims.
Kremlin spokesman Dmitry Peskov said President Putin had ordered the chief of Russia's National Guard to "work out as a matter of urgency new regulations on the types of weapon that can be in civilian circulation and that can be owned by the public".
The instruction was issued "given the type of firearm used by the shooter", Mr Peskov said. "The fact is that sometimes types of small arms are registered as hunting weapons, which in some countries are used as assault rifles," he explained.
Poorly guarded schools and a gun debate
Olga Ivshina, BBC News
People in Kazan seem to be completely shocked and devastated by what has happened. It is a big city - with more than one million people - which has enjoyed peace and stability over the past decade.
Schools in Kazan - as well as in most other Russian cities - are not really guarded. Usually it is just one or two unarmed private security guards who meet people coming to the school at the gates. Often many of these so-called security officers are pensioners with no special training. But even if they had any it is hard to confront an armed person with bare hands.
It is worth mentioning that the Kazan gunman allegedly used a gun very similar to one the attacker in Crimea used in 2018. It is a relatively cheap but powerful rifle which can be bought for the equivalent of just $280 (£200). There are a lot of discussions now in Russia about whether the regulations for civilian gun ownership should be changed.
How frequent are school shootings in Russia?
Shootings at schools are relatively rare in Russia compared with other countries.
- In November 2019 a 19-year-old student shot dead a classmate and injured three others before killing himself in the far eastern city of Blagoveshchensk. Investigators said the motive for the attack may have been a personal conflict
- In October 2018 a teenager armed with a semi-automatic shotgun killed 20 people at a technical college in the city of Kerch in Russian-annexed Crimea. He then shot himself dead
- In February 2013, a 15-year-old student shot dead a teacher and a police officer, injuring a second police officer, when he took hostages at a school in Moscow. Investigators said the killer appeared to have had an "emotional breakdown"
Are you in the area? Did you witness what happened? If it is safe to do so share your experiences by emailing firstname.lastname@example.org.
Please include a contact number if you are willing to speak to a BBC journalist. You can also get in touch in the following ways: