The motive for the attack is not yet known
Knifeman killed at Iran ambassador's Vienna home, police say
A 26-year-old Austrian was shot dead outside the Iranian ambassador's residence in Vienna on Sunday night after he attacked a guard with a knife, police said.
The assailant "died on the spot" after the soldier opened fire, police spokesman Harald Soeros said. He added that the attack took place just before midnight local time.
The motive for the attack is not yet known, police said on Monday.
The 23-year-old soldier, who was standing guard outside the building, suffered a wound to his upper arm in the attack.
"He initially used pepper spray" against the assailant, Mr Soeros said, before opening fire. He was believed to have fired his weapon at least four times.
Read more: Iran regime opponents rally across Europe
According to early indications he "acted within the rules", said a spokesman from the ministry of defence quoted by the APA agency.
The official added that the soldier, who is from the Tyrol region of Austria, has been treated in hospital.
Police have ordered reinforcements around all diplomatic missions in the city.
The incident comes just days after two knife attacks in Vienna, including one that left a couple and their 17-year-old daughter with severe injuries.
A 23-year-old Afghan national confessed to those assaults but denied any political motive.