The gunman, who was a student, opened fire at a university in the Russian city of Perm on Monday, killing eight people and injuring several others, the Investigative Committee law enforcement says.
The gunman was detained shortly after the incident at Perm State University, located around 1300 kilometres east of Moscow, a university spokesperson and the police said.
Students jumped from first-floor windows to escape the building, landing heavily on the ground before running to safety, local media video footage from the scene showed.
Russia's Investigative Committee, the agency that handles probes into major crimes, said the gunman had been identified as a student at the university.
Russia has strict restrictions on civilian firearm ownership, but some categories of guns are available for purchase for hunting, self-defence or sport, once would-be owners have passed tests and met other requirements.