A gunman stormed Azerbaijan's embassy in Tehran on Friday, killing the mission's head of security in an attack Iran said was motivated by personal reasons but Baku labelled an act of "terrorism".
Azerbaijan's foreign ministry said "responsibility" for the shooting, which also wounded two embassy security guards, lies with Iran -- with spokesman Ayxan Hacizada telling media in his country a recent anti-Azerbaijani campaign in Iran had "encouraged the attack".
Hacizada later told Turkey's state broadcaster TRT Haber that embassy staff were "being evacuated from Iran".
Leaked video footage from the embassy, widely shared on social media and published by Iranian media, shows two men parking a car and entering the building in east Tehran, before a speeding car approaches and crashes into the rear of their vehicle.
A man holding what appears to be a semi-automatic rifle is seen emerging from the second car and motioning to a security guard before forcing his way into the embassy.
Another unverified video apparently filmed inside the embassy shows two men entering and one of them opening the door in response to commotion outside, allowing a gunman to barge into the building and open fire.
One man appears to be struck in the torso by a bullet and collapses behind an internal door while the assailant is tackled by another guard.
An AFP photo shows what appears to be bullet holes in the front door of the embassy.
- 'Personal motive' -
Following the attack, Azerbaijan's foreign ministry said the diplomatic mission's head of security was killed and that two guards were wounded but in a "satisfactory" condition, adding that an investigation had been launched.
Azerbaijan's President Ilham Aliyev said on Twitter that the attack was an act of "terrorism" and named the dead security officer as First Lieutenant Orkhan Rizvan.
Tehran's police chief General Hossein Rahimi said the attacker had been arrested and was an Iranian man married to an Azerbaijani woman.
"He claims his wife has been held at the embassy for nine months," Rahimi said on television.
Tasnim news agency said the assailant had filed a missing persons report for his wife in April last year, adding however that she had already returned to Azerbaijan, citing legal documents from the case.
Iran's foreign ministry spokesman Nasser Kanani said Tehran strongly condemned the attack, adding that the motivations behind it were "personal".
In a joint statement, Iran's foreign and interior ministries said that "based on the evidence and preliminary observations the attacker fired with a very personal motive".
In a telephone call with his Azerbaijani counterpart Jeyhun Bayramov, Foreign Minister Hossein Amir-Abdollahian "proposed cooperation between the two countries in investigating" the attack.
"We must not allow this incident to negatively affect relations between our two countries," Iran's foreign ministry quoted him as saying.
- 'Unacceptable violence' -
Early reports in Iranian media indicated the gunman had entered the embassy with his two young children, but they could not be seen in the videos shared online.
Another video posted on social media showed the body of a man lying in a pool of blood inside the embassy, surrounded by medical and security personnel.
A paramedic is heard saying in Azeri that the person "has no vital signs".
Iran is home to millions of Turkic-speaking, ethnic Azerbaijanis and it has long accused Baku of fomenting separatist sentiment inside its territory.
Relations between the two countries have traditionally been sour, with the former Soviet republic a close ally of Iran's historical rival Turkey.
Tehran also fears that Azerbaijani territory could be used for a possible offensive against Iran by Israel, a major supplier of arms to Baku.
The United States condemned Friday's "unacceptable violence" and urged a prompt investigation into the attack.
"We remind the government of Iran of its responsibility under the Geneva Convention to protect foreign diplomats in Iran," State Department spokesman Ned Price said.
Russia's foreign ministry spokeswoman Maria Zakharova said Moscow was "shocked" by the attack.
"We offer our condolences and support to our Azerbaijani colleagues," she wrote on Telegram.