MOSCOW — Gunfire and explosions erupted at a school in central Russia on Tuesday, killing seven students and two school employees, according to witnesses and officials who blamed a teenager for the rare mass shooting in the country.
Within hours, President Vladimir V. Putin said he had ordered a tightening of Russia’s already restrictive laws on civilian gun ownership, a move that is likely to be implemented in the country’s top-down political system.
“The thing is that firearms, which are used as assault rifles and similar weapons in certain countries, are sometimes registered as hunting guns,” said the Kremlin spokesman, Dmitri S. Peskov. “The Russian National Guard will urgently consider the issue.”
In a scene of mayhem captured on cellphone videos, students jumped from windows and ran as shots rang out, and the police and ambulances raced to the school in Kazan, a provincial capital about 450 miles east of Moscow.
Students and teachers in the school’s upper floors barricaded themselves in classrooms and waited for help, said Vyacheslav Yegoshin, a 15-year-old who witnessed the shooting from outside the building because he was late for school Tuesday.
“It was scary, and everybody was crying,” Mr. Yegoshin said in a telephone interview.
A regional governor, Rustam Minnikhanov, said seven students, one teacher and an employee of the school whose job he did not specify, had died and more than 20 people were wounded. The wounded ranged in age from 7 to 62. State media reported that two students had died from the fall after leaping from upper-floor windows.
Mr. Minnikhanov said a 19-year-old suspect was in custody.
Ria, a state news agency, published a video of a young man it said was the suspect, bound by his hands and feet to the bars of a cell while talking to an investigator. He appeared agitated and incoherent, saying he realized two months ago that “I hate everybody.” The video could not be independently confirmed.
Russia has strict gun ownership laws. Applicants for a firearm’s license must pass psychological exams and own a smoothbore shotgun for a trial period before obtaining a rifle. Pistol ownership is more tightly controlled, largely limited to those, such as retiring military officers, who are given a pistol as an award for their service.
On Tuesday, Mr. Putin ordered the head of the agency regulating gun ownership, the Russian National Guard, to draft new rules.
The order asked for a “swift working out of new positions about the types of weapons that can be in civilian circulation, can be in the hands of the population,” Mr. Peskov said.
A member of Russia’s Parliament, Aleksandr Khinshtein, said the attacker had obtained a gun license on April 28 for a semiautomatic shotgun.
The Russian federal government sent a plane from Moscow with medics and psychologists to help treat children in the school, called Gymnasium No. 175, which accommodates grades one to 11. The health and education ministers also flew to Kazan.
In interviews with Russian media, students described a harrowing ordeal. One recalled cowering behind desks while shots rang out in the corridor and somebody — presumably the shooter — knocked loudly on the locked door of a classroom.
The students got a second scare when the police arrived and also knocked on the door. An officer convinced the students it was safe by sliding his badge under the door.
Pictures posted on social media, described as scenes taken after the shooting, showed doors torn from their frames and debris littering the hallways. It was not clear whether the doors had been ripped out during the attack or during the security service operation against the shooter.
In the most recent similar mass shooting — in 2018 at a college in Kerch, a town in Russian-occupied Crimea — 21 people were killed and 50 were wounded. Other less lethal incidents in schools and colleges have followed, including several attacks with air guns and an ax attack in Ulan-Ude, a city in Siberia, that wounded a teacher.
In response, Nikolai Patrushev, the director of Russia’s National Security Council, in 2019 blamed unrestricted access to the internet for children, saying that it “destructively influences the consciousness and behavior of students” by exposing them to violent content.
Mr. Putin did not immediately call for stricter gun laws after the earlier shootings.
Oleg Matsnev contributed reporting.