The man entered the Federal Security Service (FSB) office in the city of Arkhangelsk in northern Russia and removed a bomb from a bag, which detonated, Moscow’s anti-terrorist committee said.
It confirmed three FSB employees were injured in the explosion and said at least one was in intensive care.
Russian investigators identified the attacker as a local 17-year-old man and said they are treating the attack as an act of terrorism.
It was unclear if the man meant to just leave the bomb or had intended to blow himself up.
A short while before the blast, a message about a terror attack appeared on a leftist-anarchist forum.
In the chat, the person, who identifies as a "anarchist-communist" mentions an exact place and a motive: fabrications and torture allegedly committed by the FSB.
The chat was open, and several of its members previously complained about police and security services infiltrating the chat
Governor Igor Orlov said authorities were boosting security measures at all public offices after the attack.
Vladimir Putin’s spokesman said the president had been informed of the attack.
The FSB and other security agencies have been targeted in the past in another region, the North Caucasus, mostly by Islamist insurgents.
More about: Russia