The gunman was detained after the shooting at Perm State University, according to the Interior Ministry.
Students and staff locked themselves in rooms, and the university urged those who could leave the campus to do so.
The state Tass news agency reported some students jumped out of windows during the attack.
The university, which has 12,000 students, said about 3,000 people were on the campus at the time of the shooting.
The city of Perm is about 700 miles east of Moscow with a population of around a million people.
The perpetrator used a gun designed to fire non-lethal rubber or plastic projectiles. Such weapons can be modified to fire other ammunition.
The gunman reportedly owned the weapon legally.
The Health Ministry said 24 people were hurt - 19 from bullet wounds. It was not clear how the others were injured.