Within the Middle East historical conflicts have always colored neighbouring Arab countries' perceptions about Iran. At times peacefully coexisting, while at other times in bitter conflict. North African Arabs generally enjoyed closer relations with Iran due to limited historical connection between them and Iran.
The Islamic conquest of Persia led to the end of the Sassanid Empire and the eventual decline of the Zoroastrian religion in Persia (modern day Iran). However, the achievements of the previous Persian civilizations were not lost, but were to a great extent absorbed by the new Islamic policy. In fact, the Islamic Golden Age is largely due to the previous works of the Sassanid dynasty.
The Sassanid Empire fell to the Arabs mainly due to internal issues and the exhaustion of the Sassanid army because of continuous war with the Roman empire, the White Huns, Kushans, Khazars and other Steppe people. The entire war had been decisively summed up in the battle of Qadisiya. After the subjugation of the Persian army, the Arabs marched straight into the heart of Sassinid Persia, where countless libraries and books, such as the ones in Ctesiphon, were destroyed and burned with the approvement of Caliph Omar. Countless artifacts were destroy; the tomb of Cyrus the Great and Takhte-Solyman (an ancient Zoroastrian fire temple) were to be destroyed, but the Iranians lied to the Arabs and told them that Cyrus's tomb was the tomb of Prophet Suleiman's mother and Takhte-Solyman was Prophet Suleiman's tomb. Kaveh Farrokh states in his book Shadows in the Desert: Ancient Persia at War "The local inhabitants made a desperate last stand at Veh Ardashir against the Arabs who finally broke into all of Ctesiphon in 637. For the first time the Arabs witnessed the riches, luxuries, arts architecture and sophistication of one of the world’s great empires. Looting reached epic proportions. One fifth of the looted goods were sent from Ctesiphon to Caliph Omar at Medina. So great was the haul of booty that every Arab soldier was able to appropriate 12000 Dirhams worth of goods roughly the equivalent of 250,000 US Dollars at the time of writing. Nearly 40,000 captured Sassanian noblemen were taken to Arabia and sold as slaves." The population of Rayy, Isfahan and Hamadan were exterminated thrice due to revolts. Much of this invasion and enslavement of the Persian people and onslaught of the Sassanids has left a bitter taste in Iranian people's mouth.
After the Islamic revolution of Iran the foreign policy of Iran changed dramatically. In many cases diplomatically inimical Arab nations became more cooperative with Iran, while some formerly supportive nations decreased their support.
Ayatollah Khomeini, leader of the Islamic revolution and founder of the Islamic Republic of Iran and its first supreme leader declared that, "The concept of monarchy totally contradicts Islam." Therefore Arab leaders developed a hostile attitude towards the Islamic republic of Iran. Khomeini's idea of supporting the mustad`afeen (those who are wronged or oppressed) as opposed to the mustakbareen (those who are arrogant) led to many problems with neighboring countries due to some Arab regimes being judged by Iranian jurists to be among the mustakbareen. Ayatollah Khomeini was open about his intention to export the revolution to other parts of the Muslim world. Thus, during the early 1980s, Iran was isolated regionally and internationally. This diplomatic and economic isolation intensified during the Iran–Iraq War in which almost all Arab states, except Syria, supported Iraq logistically and economically on moral grounds. According to some observers, Saddam Hussein fought on behalf of other Arab states that viewed the Islamic Republic as a potential threat to their stability.
In the late 1980s and early 1990s, the revolutionary zeal cooled and a degree of pragmatism was adopted by Iranian policy makers. During the presidency of Akbar Hashemi and Mohammad Khatami Iranian foreign policy switched to reducing international tensions and Iran tried to normalize its relations with its Arab neighbors. When the U.S. attacked Iraq in the early 1990s, it indeliberately promoted Iran's political influence in the Middle East.
Since 2000 the situation has changed completely. The most significant factor has been the Bush administration's decision to attack Iraq in 2003 which led to the fall of Saddam, a ba'athist leader with pan-Arab sympathies who was determined to balance Shi'a Iran's regional influence. With the deposition of Saddam, Iran found a major obstacle to its expansion removed. This gave Iran a good chance to emerge as a major player in the Middle East with Islamic ideology which can fill the void of Marxism, Socialism and Nationalism in the region especially among Shia. As Richard Haass has quoted Iran will be one of the two most powerful states in the region...The influence of Iran and groups associated with it has been reinforced. Iran could find allies in Arab world comprising Syria, Lebanon and Iraq. On the other hand some Arab states including Saudi Arabia, Jordan, Egypt and United Arab Emirates united against Iran, which are supported by the U.S.. Other Arab countries, especially those in Africa, continued to have normal relations with Iran.
Another aspect of tension between Shia-dominated Iran and Sunni-dominated Arab countries has been sectarianism. While during the early days of the Revolution Ayatollah Khomeini endeavored to bridge the gap between Shias and Sunnis by forbidding criticizing the Caliphs who preceded Ali. Also, he declared it permissible for Shiites to pray behind Sunni imams. However, the influence of Iran on Shiite communities outside its borders and the territorial disputes with Arab neighbors among other issues remain as sources of tension in Arab-Iranian relations.
The two countries broke off ties in 1993 after Algeria accused Iran of supporting the Islamic Salvation Front, the major opposition of the Algerian government. The charges were denied by Tehran. In 1998 Iran became increasingly critical of Algeria's heavy handed security forces, especially during several massacres during the Muslim holy month of Ramadan and led efforts to pressure Algeria to act more humanely through the international community. Algeria in turn blamed Iran for the massacre.
After a decade, in early September 2000, diplomatic relations between Algeria and Iran were re-established in a decision made by Iranian President Mohammad Khatami and his Algerian counterpart Abdulaziz Abdelaziz Bouteflika on the sidelines of the United Nations millennium summit . The resumption of relations paved the way for a number of agreements "on bilateral cooperation in the areas of judicial affairs, finance, industry, and air transport" . Relations continued to strengthen rapidly after that to the extent that in 2002 Iranian Defense Minister Ali Shamkhani and Algerian Joint Chief of Staff Muhamed al- Imari Wednesday signed and agreement for military and technical cooperation in Iran . In the recent 2006 UN vote on Iran's nuclear programme, Algeria abstained from voting .
After 1979 Islamic revolution in Iran, Bahraini Shia fundamentalists in 1981 orchestrated a failed coup attempt under the auspices of a front organisation, the Islamic Front for the Liberation of Bahrain. The coup would have installed a Shia cleric exiled in Iran, Hojjat ol-Eslam Hādī al-Mudarrisī, as supreme leader heading a theocratic government. The Bahraini government unofficially regarded the coup as Iran attempting to overthrow their Sunni government. Iran denied all knowledge saying the fundamentalists were inspired by the Iranian revolution but had received no support from Iran. Fearful of a recurrence, the episode caused Bahrain to crack down on its Shia population putting thousands into jail and further souring relations with Shia Iran. Recently the countries are beginning to enjoy closer relations again and have engaged in many joint economic ventures. Iran has been severely critical of Bahrain hosting the US navy Fifth Fleet within the Persian Gulf.
Relations between Egypt and Iran collapsed with the sudden eruption of the Islamic revolution in Iran in 1978-79. When the Shah fell, Egypt was bound to disapprove of his replacement, Ruhollah Khomeini, who returned the sentiment in full measure. Furthermore, in 1979, Anwar Sadat infuriated the new Iranian government by welcoming Mohammad Reza Pahlavi, the exiled Shah of Iran, for a short, but indefinite, stay . In 1979, Iran officially cut all ties with Egypt. This move was a response to the 1978 Camp David Accords, as well as Egypt's support for Iraq in the Iraq-Iran War . In 1981, Iran symbolically dedicated a street to Khaled Islambouli, Sadat's assassin.
While trade relations slowly improved during the 1990s , Khaled al-Islambouli was honored for a second time in 2001 "with a huge new mural" in Tehran . Two years later, in late 2003, Iranian President Mohammad Khatami met with the Egyptian President Hosni Mubarak in Geneva. Khatami openly invited Mubarak to Iran, but Mubarak refused to make such a trip or normalize relations until all "public tributes" to Islambouli were "erased". In early 2004, Iran agreed to change the offending street name to Muhammad al-Durrah, a 12-year-old boy who was notoriously killed by the IDF in the opening days of the Second Intifada .
On 17 September 1980, after the Islamic Revolution in Iran settled down, Iraq under Saddam Hussain declared the previous settlement of border disputes with Iran null and void. Several days later on September 22 Iraq invaded Iran in the Iran–Iraq War. Lasting till 1988 the brutal war killed over one million people and critically soured Arab-Iranian relations. The Iranian government officially viewed the conflict not as Arab vs. Iranian but from a religious perspective of Shia versus Sunni, although many in Iran did view the conflict as an Arab versus Iran issue. In Iraq the conflict was continually presented in a historical context as Arab versus Persian. The impact of the war was devastating to relations in the region; general Arab support for Iraq and a fear of Shia Muslims led to many disputes between Iran and the other Persian Gulf states. The war was a primary cause for the rise of Anti-Arabism within Iran, which had until then been largely insignificant. The war ended with a UN sponsored cease-fire.
Since the fall of Saddam Hussein and the second Iraq war, Iran has been a close alley to Iraq's new government and has established full diplomatic relations with Iraq. There has been an exponential increase in trade and tourism between the two countries. Iran was the first country in the middle east to establish full diplomatic relations with the new Iraq government. President Ahmadinejad has visited Baghdad, and on numerous occasions the Iraqi leadership has visited Tehran.
In 1980, Iran cut all ties with Jordan after the outbreak of Iran–Iraq War. Relations between the two nations resumed in 1991.
In September 2000, "King Abdullah met with Iranian President Mohammad Khatami on the sidelines of the Millennium Summit in New York.  Shortly thereafter, trade between Jordan and Iran increased dramatically. According to figures from Jordan's Central Bank, "trade between Jordan and Iran reached $20 million in 2001, up some 46 percent on the previous year's $13.7 million." 
On September 2 and 3, 2003, King Abdullah II visited Tehran, making him the first Jordanian king to visit "Tehran since the launching of the Islamic revolution in Iran in 1979".
After the Shia Islamic Revolution in Iran in 1979, Kuwaiti Prime Minister then Sabah Al-Ahmad Al-Jaber Al-Sabah (now the Amir of Kuwait) visited Iran and congratulated the Islamic Revolution, yet the Sunni led government of Kuwait became fearful of its large Shia population and of possible Iranian hegemony in the Persian Gulf and began to regard Iran with increasing suspicion. When the Iran–Iraq War broke out with Saddam Hussein's invasion of Iran, Kuwait deeply supported the Iraqi move. It was an action that was bitterly resented by Iran. Throughout the war Kuwait provided Iraq with billions of dollars in military and social aid as well as logistical support by allowing Iraqi use of its ports. Iran consequently led a failed attempt to attack a Kuwaiti refinery complex in 1981 (intercepted and blocked by Iraqi air force), which inspired subsequent acts of sabotage in 1983 and 1986. In 1985 a member of the underground pro-Iranian Iraqi radical group al-Da'wah attempted to assassinate the Kuwaiti ruler, Sheikh Jabir al-Ahmad Al Sabah.
In September 1986, while the Iran–Iraq War was still raging on, Iran began to concentrate its attacks on Persian Gulf shipping, largely on Kuwaiti tankers in an effort to dissuade Arab support for Iraq. This led Kuwait to invite both the Soviet Union (with which it had established diplomatic relations in 1963) and the United States to provide protection for its tankers in early 1987.
In 1990, following the Persian Gulf War Iraqi-Kuwaiti relations suffered bitterly and consequently Kuwaiti-Iranian relations began to improve. Bilateral relations were gradually strengthened, with exchanges of Iranian and Kuwaiti political and economic delegations leading to the signing of several economic and trade agreements.
In February 2006, Iranian President Mahmoud Ahmadinejad vistied Kuwait opening a new chapter in relations between the two countries. The well reported visit was the first to Kuwait by a high-ranking Iranian official in 27 years. 
Relations with the Lebanese government have been extremley strained and have been rapidly deteriorating since the 2006 war. Iran recognizes and supports the Lebanese militia Hezbollah. The official Lebanese government claims that Iran only recognizes Lebanon in order to use it as a proxy state to attack Israel, maintain its stance in the region and warn the United States. Lebanon also claims that Iran aims to dismantle the weakened administration in favor of replacing it with an Islamic theocracy similar to that of Iran. After all parties of the Lebanese government reached a consensus as part of the Doha Agreement, Iranian foreign minister Manouchehr Mottaki traveled to Lebanon and welcomed the agreement as a "great achievement" for the Lebanese people.
This was followed by Lebanon President visit to Tehran in 2008 and the signing of a military and economic agreement between the two countries.
Libya broke rank with most of the Arab states when it came out in support of Iran during the Iran–Iraq War.
In 1981, Iran cut off all diplomatic ties with Rabat in response to King Hassan II's decision to give asylum to the exiled Shah. A decade later, diplomatic relations between the two nations were renewed, but another decade would have to pass before Abderrahmane Youssoufi, the prime minister of Morocco, would lead the first Moroccan delegation to the Islamic Republic of Iran. Iran supports the independence of Western Sahara as the Sahrawi Arab Democratic Republic.
Morocco has cut diplomatic links with Iran on Marh 06, 2009. Morocco's Foreign Ministry said in a press release on Friday that Morocco has cut its diplomatic ties with Iran following Tehran's remarks over Bahrain. Morocco also accused Iran spreading its Shi’ite brand of Islam in Sunni Morocco.
During the Iran–Iraq War Oman remained neutral, preferring to take no sides. This allowed it to be in the position to attempt to bring Iran and Iraq into a negotiated settlement after the war in 1994.
Since then peaceful ties have continued and expanded .
The Islamic Republic regime of Iran (established after the 1979 Iranian Revolution) closed the Israeli embassy in Tehran and replaced it with a Palestinian embassy. Iran favors Palestinian national ambitions and officially endorses the replacement of Israel with a unitary Palestinian state.
Iran does not recognize the state of Israel and instead regards it as 'Palestine under occupation'. During the era of the Iranian Monarchy (1948-1979) under the Pahlavi Dynasty, Iran enjoyed cordial relations with Israel. Israel regarded Iran, a non-Arab power on the periphery of the Arab world, as a natural ally and counterweight to Arab ambitions as part of David Ben-Gurion's alliance of the periphery. Even after the Iranian Revolution and Ayatollah Khomeini's public condemnations of the "Zionist entity". Iran suggests that all Israeli 'occupied territory' is either given back to their respective countries (ex. Golan Heights back to Syria) or is replaced with a Palestinian state. Iran also feels that Jerusalem should returned to the Palestinians.
Throughout the Iran–Iraq War (1980-1988), Qatar supported Saddam Hussein's Iraq financially by providing large loans and cash gifts. Iran's claim in May 1989 that one-third of Qatar's North Field gas reservoir lay under Iranian waters apparently was resolved by an agreement to exploit the field jointly.
In 1991, following the end of the Persian Gulf War, Shaykh Hamad ibn Khalifa welcomed Iranian participation in Persian Gulf security arrangements, however due to resistance from other Persian Gulf Arab States these never came into fruition. Additionally, plans were being formulated in 1992 to pipe water from the Karun River in Iran to Qatar, but after local resistance in Iran this was laid to rest.
The Iranian community in Qatar, although large, is well integrated and has not posed a threat to the regime. Today relations between the two countries are cordial.
Following the outbreak of the Iran–Iraq War, Iranian pilgrims felt they had to hold a political demonstration against Saudi support for Iraq during the Iran–Iraq War during the Hajj in Mecca. In 1987 they succeeded, however Saudi police crushed the demonstration violently causing the Iranian pilgrims to riot.
Immediately following the riot, Ruhollah Khomeini called for Muslims to avenge the pilgrims' deaths by overthrowing the Saudi royal family. The Saudi government blamed the riot on the Iranian pilgrims and claimed that the pilgrim riot had been part of a plot to destabilize their rule. The following day mobs attacked the Kuwaiti and Saudi embassies in Tehran.
In 2001, Iran and Saudi Arabia signed a "major security accord to combat , drug trafficking and organized crime".
In 2008, the Saudi King Abdullah invited former Iranian President Ali Akbar Hashemi Rafsanjani to visit Saudi Arabia for the purpose of attending an Islamic conference. Rafsanji responded by saying that the opportunity was a way "Iran and Saudi Arabia can resolve differences in the Muslim world."
In 2006, the Islamic Courts Union took over Mogadishu from CIA-backed ARPCT. Iran has been one of several nations backing the public uprising. According to Prime Minister Ali Mohammed Ghedi, Iran, Egypt, and Libya are helping the militia. The Prime Minister accuses these countries of wanting more conflict in Somalia, which seems contradictory because of the Transitional Government's inability to extend authority beyond Baidoa, which is something the Islamic Republic sees.
In 1991, "there was evidence of increasing economic and military links between Sudan and Iran... Some 2,000 Iranian Revolutionary Guards were allegedly dispatched to Sudan to assist with the training of the Sudanese army, and in December President Rafsanjani of Iran made an official visit to Sudan, during which a trade agreement between the two countries was concluded. In November 1993 Iran was reported to have financed Sudan's purchase of some 20 Chinese ground-attack aircraft. In April 1996 the Government was reported to be granting the Iranian navy the use of marine facilities in exchange for financial assistance for the purchase of arms although, in response to a Sudanese request for military aid in 1997, Iran provided assistance only with military maintenance." 
During the last week of April 2006, Sudanese President Omar Hasan Ahmad al-Bashir met with a number of Iranian public figures in Tehran, including the Supreme Leader Ali Khamenei and President Mahmoud Ahmadinejad. In a joint news conference with al-Bashir on 24 April, Ahmadinejad explained to the public his belief that "expansion of ties between the two countries serves the interests of both nations, the region, and the Islamic world, particularly in terms of boosting peace and stability." Before the conference ended, al-Bashir congratulated Iran for its successful pursuit of "nuclear power for peaceful purposes," while Ahmadinejad restated his opposition to the participation of UN Peacekeepers in Darfur.
During the Iran–Iraq War Syria sided with Iran and was isolated by the other Arab countries, with the exception of Libya. Iran and Syria have had a strategic alliance ever since, based partially on their common animosity towards Saddam Hussein.
On June 16, 2006 the defence ministers of Iran and Syria signed an agreement for military cooperation against what they called the "common threats" presented by Israel and the United States. Details of the agreement were not specified, however Syrian defense minister Najjar said "Iran considers Syria's security its own security, and we consider our defense capabilities to be those of Syria." The visit also resulted in the sale of Iranian military hardware to Syria.. In addition to receiving military hardware, Iran has consistently invested billions of dollars into the Syrian economy. It should be noted, however, that the Syrian leadership, including President Assad himself, belongs predominantly to the Alawite branch of Shi'a Islam. Currently, Iran is involved in implementing several industrial projects in Syria, including cement factories, car assembly lines, power plants, and silo construction. Iran also plans to set up a joint Iranian-Syrian bank in the future.
On February 17, 2007, Presidents Ahmadinejad and Assad met in Tehran. Ahmadinejad afterwards declared that they would form an alliance to combat US and Israeli conspiracies against the Islamic world.
Following labour unrest led by the General Union of Tunisian Workers throughout the 1970s and early 80s, in 1987 President Bourguiba instigated a massive purge of Tunisian politics under the pretext of a "terrorist conspiracy" sponsored by Iran. Iran protested and diplomatic relations were promptly broken. On 27 September 1987, a state security court found 76 defendants guilty of plotting against the government and planting bombs; seven (five in absentia) were sentenced to death  .
In September 1990, Tunisia and Iran restored diplomatic relations once again. Relations remained unchanged until June 1999, when the speaker of the Tunisian Parliament, Fuad al-Mubze, became the first Tunisian official to visit Iran since the beginning of the Islamic Revolution in 1979. His visit was intended to reflect "the rapid improvement in bilateral relations since the setting up of the joint committee for cooperation on the level of the foreign ministers in the mid-1990s" . By 2000, trade relations between the two nations reached USD 73 million. The following year, on April 19, 2001, Tunisian prime minister Muhammad al-Ghanoushe visited Tehran on "an official visit" to sign a new joint trade agreement with his counterpart.
Iranian investors have a wide presence in the UAE accounting for 10 percent of the Arab country’s population. Based on recent statistics nearly 400,000 Iranians live in the UAE running 10,000 small business firms.
Following the Islamic Revolution in Iran, the UAE has been pushing for the return of the islands. The countries maintain very close economic ties and the UAE has a significant Iranian expatriate community. Outstanding conflicts are:
However, Iran has criticized the UAE for allowing France to develop its first permanent base in the Persian Gulf region there.
On February 27, 1980, Iran gave formal recognition to the Sahrawi Arab Democratic Republic as the legitimate government of all Western Sahara. They have continued their support for the Polisario Front ever since.
Following the first two decades of the Islamic Revolution, ties between Tehran and Sana'a were never strong, but in recent years the two countries have attempted to settle their differences. One sign of this came on 2003-12-02, when the Yemeni foreign ministry announced that "Yemen welcomes Iran's request to participate in the Arab League as an observer member."
On 2006-05-10, "the Yemeni ambassador to Iran Jamal al-Salal met... with the Iranian deputy foreign minister for the Arab and North Africa Affairs Mohammad Baqiri and the deputy assistant of the foreign minister for educational affairs and researches Mohammadi respectively. The meeting centered on boosting mutual cooperation between the two countries and means to reinforce them. The talks also dealt with issues of common interest at the regional and Islamic levels."
The Tensions between Yemeni government and Iran have rised in the past weeks, due to the Yemeni War, in Sa'dah, and claiming that the Militias have been trained in Iran.