Victims include seven children at the school of about 1,000 pupils in the city of Izhevsk.
The gunman killed himself at the scene. He was a former pupil of the school.
Russian media have posted videos which appear to show panic inside the building where the shooting took place.
Some footage shows blood on a classroom floor and a bullet hole in a window, with children crouching down underneath desks.
Seven children and six adults were killed, including two security guards and two teachers, according to Russian officials. Staff and pupils have been evacuated from the school buildings.
One local MP said the attacker – named as Artem Kazantsev- had been armed with two pistols.
A video posted online by the investigative committee shows the gunman lying dead on the floor wearing a T-shirt with a Nazi symbol and a balaclava. Investigators are searching his place of residence.
A mourning period until 29 September has been announced by the head of the region. Russian President Vladimir Putin’s spokesperson said he is “deeply mourning” the attack.
The school is in the centre of Izhevsk, a city of about 650,000 residents, close to central government buildings.