Surveillance camera footage, inside the building of the Azerbaijani embassy in the Iranian capital, showed the moment a gunman stormed in with a Kalashnikov machine gun and opened fire on those present, killing the head of the embassy's security service and wounding two.

In a strongly worded statement, the Azerbaijani Foreign Ministry accused Iran of ignoring Baku's calls for a long time to enhance security at its embassy in Tehran.

The weapon of the terrorist campaign is carried out by the embassy of #Azerbaijan #Iraneast

Possibility of membership #Torrist in armed police (SPAH) in the past, but there is no confirmation https://t.co/rAwYmjK6Sz

- BagimsizGuneyAz (@BagimsizGuneyAz) January 27, 2023

"Unfortunately, the bloody terrorist act shows the serious consequences of not paying due attention to our continuous appeals in this regard," she added, noting that Baku summoned the Iranian ambassador against the background of the armed attack.

The clip showed the attacker getting out of his car with his weapon in his hand, which he used in the attack. It also showed him passing in front of the security man standing at the guard post at the entrance to the embassy.

Doom movie from the moment of the terrorist campaign to the Embassy of Azerbaijan in Tehran

Hemantour ke ddeh mashoud claim hamra boden du kodak in kenar realist ndard pic.twitter.com/4IecrK2ZeS https://t.co/SfnIDQLesL

- BagimsizGuneyAz (@BagimsizGuneyAz) January 27, 2023

In a statement to Tasnim news agency, Tehran Police Chief General Hossein Rahimi said, "(the) person who attacked the Azerbaijani embassy with a firearm this morning (Friday) was arrested."

He explained to a local television that this person is "an Iranian married to an Azerbaijani woman," noting that his motives were "personal and family."