Police say an Austrian attacker was shot and killed by the guard he wounded outside the Iranian ambassador's residence in Vienna.
Following the late-night incident, investigators identified the attacker as Mohamed E., a 26-year-old Austrian national with family roots in Egypt. His last name was withheld, according to Austrian privacy laws.
Police searched the man's Vienna home and started looking into his social circle, mobile phone and email records and other documents.
A police spokesman said that investigators could not yet rule out any motive, including religious, political or psychological factors that may have driven him to his actions.
"The attacker stabbed the soldier repeatedly. He was only saved by a stab-proof vest," the spokesman said, adding that the two men ended up grappling on the ground.
"The soldier defended himself well and was then able to reach for his service weapon and fire shots," he added.
The man drew a knife from his jacket and started stabbing the soldier, who was standing guard alone, in front of the villa at 11:30 pm (2230 GMT) on Sunday, according to a police report.
The soldier at first sprayed his attacker with pepper spray but a struggle ensued in which both men fell to the ground, "while the suspect kept stabbing the soldier incessantly," the report said, citing evidence from a surveillance video.
The soldier fired off several shots, fatally injuring the attacker.
The man died at the scene, in the affluent district of Hietzing, while the soldier sustained a cut to his arm and was taken to hospital suffering from shock.
Police have ordered additional security for other diplomatic buildings in Vienna.
A Defense Ministry spokesman said the soldier had acted correctly by first using pepper spray before resorting to his weapon.
"From the current standpoint he did everything right," Michael Bauer told Austrian news wire APA.
Vienna is a key diplomatic location for Tehran: The city is the seat of the International Atomic Energy Agency (IAEA), which monitors Iran's compliance with the 2015 international deal to curb the country's nuclear programme.
On Wednesday, four people were also injured in a stabbing rampage in the Austrian capital.
An Afghan drug addict later confessed to randomly targeting a family of three outside a restaurant and an Afghan acquaintance during the attack.
Police said the 23-year-old had blamed his "bad aggressive mood as well as anger at his overall situation in life."