A gunman armed with explosives entered Estonia's Defense Ministry on Thursday and opened fire, but police stormed the building and killed him, officials said. No one else was hurt.
Many employees were seen escaping from first-floor windows as the gunman detonated a smoke bomb and fired shots in the central Tallinn building.
Defense Minister Mart Laar said authorities should investigate whether the assailant had been partially motivated by the terrorist who carried out last month's massacre in Norway that killed 77 people.
"That is something that needs to be carefully investigated," Laar told Estonian national broadcaster ERR. He was not in the building at the time of Thursday's mid-afternoon attack.
Officials identified the attacker as Karen Drambjan, an Armenian-born lawyer who has held Estonian citizenship since the early 1990s. He was a member of the small, left-wing Estonian United Left Party that is not represented in Parliament, ministry spokesman Peeter Kuimet said.
Officials said they knew of no possible motive, pending an investigation by the security police and the Prosecutor's Office.
Estonian Security Police spokesman Erik Heldna said the gunman had no connection to the ministry.
"He was killed in a gunfire exchange that took place between the assailant and police," Heldna said, dismissing earlier reports that Drambjan had tried to take hostages.
Estonian Prime Minister Andrus Ansip described the incident as "extremely regrettable," saying Drambjan had a "substantial amount" of explosives and rounds of ammunition on him.
"From the bottom of my heart, I extend my thanks to all of those people who helped solve this situation," Ansip told reporters.
The attacker, who was known to the police but had no criminal record, fired several shots with a pistol but was unable to move beyond the lobby, Heldna said.
Hasse Svens, a journalist working for Swedish broadcaster SVT, was near the building when the shooting started.
"When I reached the Defense Ministry I heard several shots and a powerful explosion and also smelled the gunpowder smoke," he told SVT by telephone.
The attack shocked the tiny, tranquil Baltic nation of 1.3 million people where shootings are rare.
In Norway, a right-wing extremist detonated a bomb outside government buildings in Oslo on July 22, killing eight, followed by a massacre at a youth camp on an island outside the Norwegian capital where he shot dead 69 people.