An armed man killed two people and injured another before he was shot dead at the office of Russia's FSB intelligence agency in the Far East on Friday.
The FSB, the main successor to the KGB, said in a statement that the man passed by metal detectors, entered the reception area of its office in the regional capital of Khabarovsk and opened fire.
One FSB officer and one visitor were killed on spot and one was wounded. Security fired back, killing the attacker.
The FSB later identified the man as a local resident aged between 17 and 18 and said it had information that he was a member of neo-Nazi gang.
Social media users posted pictures of police cordons around the FSB building in Khabarovsk with special forces standing by.