A student has been detained in Moscow after entering a secondary school and taking more than 20 fellow pupils hostage, Russian police say.
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.
[youtube QVk2v-eGPtY 650]