The gunman killed one police officer and one biology teacher, police said. Another policeman was shot and injured.
The hostages the gunman took have been released, police said.
The incident, on the outskirts of Moscow, comes as Russia prepares to host the Winter Olympic Games, due to start in Sochi this week.
The gunman is believed to be a pupil at School No. 263 on the northern outskirts of Moscow.
“The person who took 20 people and a teacher hostage is a student in the upper classes at the same school,” an interior ministry spokesman said on state TV.
“He has been neutralized and all the students have been freed,” he said.
“One policeman was fatally wounded during the operation and died in hospital, and a teacher at School No. 263 was also killed,” he added.
It is not clear how the teacher and the policeman died.
A school official told Russian television that all children and teachers had been evacuated from the school after the incident.
The gunman opened fire on police officers who arrived at the scene, reports say.
QVk2v-eGPtYPresident Joe Biden has urged pro-Palestinian protesters on university campuses to uphold the rule of…
Blue Ivy Carter has joined the voice cast of The Lion King prequel Mufasa: The…
At least five people, including a four-month-old baby, have been killed after dozens of tornadoes…
Harvey Weinstein has been hospitalized just days after his 2020 rape conviction in New York…
Hamas has published a video showing the first proof of life of US and Israeli…
Prosecutors and Donald Trump’s attorneys delivered opening statements and the first witness was called on…