The assailant crossed the campus on Monday morning and started firing.
Students and teachers barricaded themselves inside the university building; others were seen jumping out of the windows.
Police said they injured and detained the attacker, who is said to be a student. The local health department said 19 people were injured in the attack.
The incident happened at 11am (06:00 GMT) at Perm State University, 1,300 kilometers (800 miles) east of the capital, Moscow, in the Urals.
Videos circulating on social media show students removing goods through windows in campus buildings before jumping and fleeing from the shooter.
Other reports say the man had written on social media that he worked alone and had no political or religious motives. He also said that he was consumed with hatred and intended to harm others.
“I’ve been thinking about this for a long time, it’s been years since I realized it was time to do what I dreamed of,” he said in a social media account he was given, which was later down, the Reuters news agency reported.
The gunman was identified as a university student, according to the Criminal Investigation Committee.
A university lecturer told the BBC (British Broadcasting Corporation) he saw students running into the building, and people jumping out of the second floor while on his way to class.
“They came out with rats, shouting,” he said. “One of the students told me it was a shooting. I heard pops, everyone started spreading in different ways. I went to my students in the second building and kept hearing pops.”
There are about ten buildings at Perm University campuses, and security forces immediately shut down all buildings and facilities, he added.
Perm University posted a message on social media urging students on the site to stay in class.