According to local authorities, at least seven children and two adults were killed, and over 20 others were injured, in a mass shooting at a school in the Russian city of Kazan.

On Tuesday morning, a gunman opened fire on School No. 175 in the city about 500 miles east of Moscow, while hundreds of children were in class. The alleged shooter, a 19-year-old man, was detained at the school, according to police.

As the sound of gunshots rang out, videos from the scene showed children attempting to flee the school building, with some jumping out of high windows. Police and emergency personnel were heavily armed when they arrived on the scene, and videos showed terrified children climbing down fire ladders to escape. Other videos showed children covered in blood lying in the grass near the school.

“It’s a great tragedy. We have lost seven children, four boys, three girls. They died here on the third floor,” Tatarstan’s president, Rustam Minnikhanov, told reporters standing outside the school following the shooting. According to him, a teacher and another female student at the school were also killed.

Seven of the children killed were eighth-graders. According to regional health authorities, at least 21 people were hospitalized, 18 of whom were children, and six are in critical condition. The majority of the children are between the ages of seven and fifteen.

After hearing explosions and gunfire, students at the school told Russian media that they locked themselves in their classrooms on the third floor. According to several accounts, the gunman attempted to break down the doors in order to gain access to the students.

“He sort of started to smash the door,” a pupil, identified as Adelya, told the Russian news site Media.Zona. “Then the police came into the corridor. He ran and started shooting, and a bullet hit our door.”

Authorities have identified the attacker as 19-year-old Ilnaz Galyaviyev, a Kazan resident and, according to local media, a former student at the school. Early reports suggested that two gunmen were present at the attack, but local authorities have since denied this and stated that he acted alone.

Galyaviyev was a student at a Kazan college until last month, but dropped out in April, according to the college. He graduated from high school four years ago and was attending college to study programming.

According to Russian officials, Galyaviyev recently obtained a gun license, receiving one in late April for a semi-automatic shotgun, which was apparently used in the attack.

The alleged shooter allegedly created a channel on the Telegram messenger a few days before the attack, according to Russian media. A man poses in a long dark coat and a mask with the word “God” written in Russian on it in photos posted on the channel. The alleged gunman refers to himself as “God” in the posts and promises to kill a “large number of bio-trash” in the near future.

After police announced that they had apprehended the shooter, local media circulated a video purporting to show Galyaviyev being questioned by police. In the video, a young man, shirtless and bound to a cage by his arms and legs, screams at an officer that “he has realized he’s a God” and that he “hates everyone.”

Although Russia has experienced numerous terrorist attacks, school shootings of the type seen in the United States are extremely rare, and this is already one of the deadliest. An 18-year-old killed 20 people and injured dozens more at a school in Kerch, Crimea, in 2018.

On Monday, President Vladimir Putin expressed his condolences to the victims and immediately directed authorities to tighten gun regulations.

Dmitry Peskov, Putin’s spokesman, said Putin had directed the head of Russia’s National Guard, which oversees gun ownership, to develop new guidelines for the types of weapons civilians are permitted to own. According to Peskov, the change was necessary to address the issue of assault weapons being incorrectly classified as hunting rifles.

Russia’s National Guard quickly stated that it would carry out Putin’s directive to develop new rules in collaboration with other government agencies. Following the attack, Tatiana Moskalkova, the country’s human rights ombudswoman, stated that the age for gun ownership should be raised to 21 except for those who have served in the armed forces.