A man who was shot dead in central Moscow after opening fire on the offices of the Federal Security Service (FSB), Russia’s main intelligence agency building, in an attack that killed two has been identified as a gun enthusiast.

Investigators named him as Yevgeny Manyurov, 39, from Podolsk, a small town some 30 miles south of Moscow.

One FSB employee was killed as Manyurov opened fire with an automatic weapon on Thursday evening, spraying the windows of the intelligence agency’s Lubyanka headquarters with bullets from the street outside. A second FSB officer died in hospital of his injuries on Friday evening.

One more FSB officer was critically wounded, while three people, including a civilian, had less serious injuries. Manyurov was then shot dead by an FSB sniper, officials said. Officers discovered grenades and an improvised explosive device in a rucksack he was carrying.

Security officials said Manyurov had not managed to enter the Lubyanka building, which previously housed the main offices of the KGB, the Soviet-era secret police.

Russian media have portrayed the gunman, who lived with his mother, as a loner obsessed with firearms. He was unemployed, but had previously worked as a security guard, including at the embassy of the United Arab Emirates in Moscow, his father told Russian media.

Manyurov recently came third in a shooting competition staged by a Soviet-era patriotic paramilitary sports group that was revived by Vladimir Putin, Russia’s president, in 2009. Police reportedly seized a small arsenal of legally owned weapons, including two semi-automatic rifles and two shotguns from his home. He is reported to have used a Kalashnikov assault rifle during Thursday’s attack.

Oleg Solovich, an instructor at the Dosaaf shooting club where Manyurov practised, said he was a “poor shot” who used to arrive at the firing range in a long black Parka raincoat with a hood up. “We advised him to take off his coat during shooting sessions, but he said he felt comfortable in it,” Solovich told Russia’s Komsomolskaya Pravda newspaper.

The motive for the attack remains unclear, although Kommersant, a daily newspaper, reported that witnesses told investigators he was shouting slogans “typical of Islamic State”.

“I noticed he had been somewhat agitated lately,” Baza, a media outlet with links to the security services, cited his mother as saying. She said he was unmarried, with no children or close friends, and that he was passionate about guns. He appears to have had no social media presence.

The assault on the FSB office took place shortly after Putin’s annual press conference in Moscow. The president was attending a gala concert at the nearby Kremlin in honour of the security services during the shootout. The attack may have been planned to coincide with the speech, an FSB source told Reuters.

Meduza, an independent news website, said that police may have continued firing for some time after Manyurov was killed, possibly injuring a passerby in the process.