Nine dead in Russia school shooting
Stay tunned with 24 News HD Android App
Interfax reported that one of the attackers, a 17-year-old, had been detained but that a second assailant was still inside the school building.
Later, the second gunman was killed, news agencies reported, citing official sources.
"According to preliminary information, the second attacker in the school in Kazan who remained in the building was killed," the TASS state news agency reported, citing a law enforcement source.
It said eight students and one teacher had been killed and that police had sealed off the fourth floor of the school and were attempting to detain the second attacker.
News agency TASS also reported nine dead and said 10 people had been injured, including several children.
Tatarstan President Rustam Minnikhanov had arrived at the scene, agencies reported.
Images broadcast on state television from the scene showed dozens of people outside the school with fire services and police vehicles lining nearby streets.
"I was in class, I first heard an explosion, then gunshots," TASS quoted a teacher as saying.
Another source cited by the RIA Novosti agency said they had heard an explosion and could see smoke rising from the building.
- Tight school security -
In October 2018, a teenage gunman killed 20 people at the Kerch technical college in Crimea, the peninsula Russia annexed from Ukraine in 2014.
Russian President Vladimir Putin at the time blamed the attack on "globalisation" and online communities dedicated to American school shootings which promoted "fake heroes".
The Crimea shooter, Vladislav Roslyakov, was able to legally obtain a gun licence after undergoing marksmanship training and being examined by a psychiatrist.
The country's FSB security service says it has prevented dozens of armed attacks on schools in recent years.
In February last year the FSB said it had detained two teenagers on suspicion of plotting an attack on a school in the city of Saratov with weapons and homemade explosives.
"The president gave an order to urgently work out a new provision concerning the types of weapons that can be in civilian hands, taking into account the weapon" used in the attack, Kremlin spokesman Dmitry Peskov told reporters.