Azerbaijan will evacuate embassy staff and family members from Iran on Sunday, the foreign ministry said, two days after a gunman shot dead a security guard and wounded two other people in an attack Baku branded as an "act of terrorism."
Police in Tehran have said they arrested a suspect and Iranian authorities condemned Friday's incident, but said the gunman appeared to have had a personal, not a political, motive.
The incident came amid increased tensions between the neighboring countries over Iran's treatment of its large ethnic Azeri minority and over Azerbaijan's decision this month to appoint its first ever ambassador to Israel.
After the attack, the Azeri foreign ministry said it summoned Iran's ambassador in Baku to demand justice and would evacuate embassy staff from Tehran. It gave no further details, including whether the embassy would continue to function.
Earlier, the ministry said the shooting was the result of Tehran failing to heed its calls for better security.
CCTV footage obtained by Reuters showed the attacker forcing his way into the embassy building and shooting at two men before a third embassy employee grapples him away.
A grey-haired man identified as the attacker was later shown on Iranian state TV saying he had acted to secure the release of his Azeri wife who he believed was being held at the embassy.
A young woman identified as the man's daughter said her mother was in Azerbaijan.
Iranian President Ebrahim Raisi called for "a comprehensive investigation" of the incident and sent his condolences to Azerbaijan and the dead man's family, state media said.