DUBAI, United Arab Emirates (AP) 鈥 A gunman stormed the Azerbaijan Embassy in Iran's capital Friday, killing its security chief and wounding two guards in an attack that spiked long-simmering tensions between the two neighboring countries.

Azerbaijan鈥檚 Foreign Ministry said it would evacuate the diplomatic post, accusing Iran of not taking reported threats against it seriously in the past that include inciting comments in hard-line media over Azerbaijan's diplomatic ties to Israel.

Tehran鈥檚 police chief, Gen. Hossein Rahimi, initially blamed the attack on 鈥減ersonal and family problems,鈥 something quickly repeated across Iranian state media. But within hours Rahimi would lose his position as police chief after footage emerged that appeared to show a security force member doing nothing to stop the attack.

鈥淧reviously, there have been attempts to threaten our diplomatic mission in Iran, and it was constantly raised before Iran to take measures to prevent such cases, and to ensure the safety of our diplomatic missions,鈥 the Azerbaijan Foreign Ministry said. 鈥淯nfortunately, the last bloody terror attack demonstrates the serious consequences of not showing proper sensitivity to our urgent appeals in this direction.鈥

鈥淲e are of the opinion that the recent anti-Azerbaijani campaign against our country in Iran led to such attack against our diplomatic mission," the ministry added.

Azerbaijan President Ilham Aliyev called the assault a 鈥渢errorist attack.鈥 He identified the dead security chief as 1st Lt. Orkhan Rizvan Oglu Askarov.

鈥淲e demand that this terrorist act be swiftly investigated and the terrorists punished,鈥 Aliyev said in a statement. "Terror against diplomatic missions is unacceptable!鈥

The attack happened Friday morning, the second day of the Iranian weekend. Surveillance video released in Azerbaijan purportedly showed the gunman arriving by car at the embassy, running into the back of another car parked out front. He exited his car, holding what appeared to be a Kalashnikov-style rifle.

From there, details immediately conflict with the Iranian account of the attack.

Iranian state TV had quoted Rahimi as saying the gunman had entered the embassy with his two children during the attack. However, surveillance footage from inside the embassy, which matched details of the aftermath and bore a timestamp matching the Azerbaijan Foreign Ministry鈥檚 statement, showed the gunman burst through the embassy鈥檚 doors alone.

Those inside tried to push through metal detectors to take cover. The man opens fire with the rifle, its muzzle flashing, as he chases after the men into the small side office. Another man bursts from a side door and fights the gunman for the rifle as the footage ends.

Another surveillance video from outside the embassy, which also corresponded to the same details, showed the gunman slam his car into another in front of the embassy. The gunman then got out and leveled his rifle at a figure inside of the Iranian police stand, likely a security force member, who stood still and did nothing as the man stormed the embassy.

Video of the aftermath showed an empty diplomatic police post just near the embassy, with one man apparently wounded in an SUV parked outside. Inside the embassy past a metal detector, paramedics stood over what appeared to be a lifeless body in a small office as blood pooled on the floor beneath.

Associated Press journalists later saw the embassy鈥檚 front door pocked with bullet holes after the attack.

Iranian prosecutor Mohammad Shahriari reportedly said the gunman's wife had disappeared in April after a visit to the embassy. The Iranian judiciary's Mizan news agency quoted Shahriari as saying the gunman believed his wife was still in the diplomatic post at the time of the attack 鈥 even though it was some eight months later.

Iran's Foreign Ministry spokesman Nasser Kanaani also said his country strongly condemned the attack, which was under investigation with 鈥渉igh priority and sensitivity.鈥 Azerbaijan also summoned Iran's ambassador there to lodge a protest over the attack as authorities replaced Rahimi, Tehran's police chief, without offering an explanation.

Azerbaijan borders Iran's northwest and belonged to the Persian Empire until the early 19th century. Ethnic Azeris also number over 12 million people in Iran and represent the Islamic Republic's largest minority group 鈥 making maintaining good relations even more important for Tehran.

There have been tensions between the two countries as . Iran also wants to maintain its 44-kilometer (27-mile) border with landlocked Armenia 鈥 something that could be threatened if Azerbaijan seizes new territory through warfare.

Iran in October launched a military exercise near the Azerbaijan border, . Azerbaijan also maintains close ties to Israel, which Tehran views as its top regional enemy. The Islamic Republic and Israel are locked in as Iran's nuclear program rapidly enriches uranium closer than ever to weapons-grade levels. Israel also offered its condolences to Azerbaijan over the attack.

Turkey, which has close ties to Azerbaijan, condemned the attack, called for the perpetrators to be brought to justice and for measures to be put in place to prevent similar attacks in the future. Turkey has backed Azerbaijan against Armenia over Nagorno-Karabakh.

鈥淭urkey, which has been subjected to similar attacks in the past, deeply shares the pain of the Azerbaijani people,鈥 a Turkish Foreign Ministry statement said. 鈥淏rotherly Azerbaijan is not alone. Our support to Azerbaijan will continue without interruption, as it always has.鈥

U.S. State Department spokesperson Ned Price said the U.S. condemns the attack. 鈥淲e echo President Aliyev鈥檚 call for a prompt investigation into this unacceptable violence,鈥 he said. 鈥淲e offer our deepest condolences to the families and loved ones of those who were killed and injured today. Any attack against diplomats or diplomatic facilities anywhere is unacceptable.鈥

___

Associated Press writers Vladimir Isachenkov in Moscow, Nasser Karimi in Tehran, Iran; Suzan Fraser in Ankara, Turkey, and Matthew Lee in Washington contributed to this report.

The 好色tv Press. All rights reserved.