One of the victims was a teacher and the other seven were students at Kazan's School No. 175, the press service of the head of the republic of Tatarstan told state media.
Russian Federation has relatively few school shootings due to normally tight security in education facilities and the difficulty of buying firearms legally, although it is possible to register hunting rifles.
Footage shared on social media showed some children jumping from windows to escape as well as injured people being evacuated.
One of the last major shootings of its kind took place in Russian-annexed Crimea in 2018 when a student at a college killed 19 before turning his gun on himself.
Eyewitnesses had reported an explosion at the school ahead of the shooting.
He was shown in camera footage wearing a similar T-shirt to Eric Harris, one of the killers in the 1999 Columbine High School shooting in the U.S., which left 13 people dead.
Russian President Vladimir Putin at the time blamed the attack on "globalisation" and online communities dedicated to American school shootings which promoted "fake heroes". "We were led out through the back door to the yard". But officials later said there was only one suspect. She said their teacher told them to stay in the room and they did not leave until the police arrived. Six children are said to be in a critical condition.
Russian state media TASS reported that a second shooter may still be roaming the school, according to a law enforcement source.
"The terrorist has been arrested". A firearm is registered in his name. "Other accomplices haven't been established, an investigation is underway", Minnikhanov said after visiting the school, noting that security had been restored to the school.