Iran-Pakistan relations have gone through many ups and downs. Iran was the first country to recognize Pakistan after it became independent in 1947. Both countries share a border of 900 kilometers. The historical and cultural linkages between people of Iran and Pakistan go way back before 1947, when Pakistan was part of Indian sub-continent. Iranian scholars and preachers had left profound impact on the people of the Indian subcontinent to the extent that Persian became the official language used in courts and government offices, until late 19th century when British replaced it with English. However, this paper will focus Iran-Pakistan relationship after 1947, and divides the relationship into two eras, ‘the Shah’s era’ and ‘the Khomeini era’.
Reza Shah Pahlavi was the ruler of Iran from 16th Sep 1941 till 11th Feb 1979, when he was overthrown by the Iranian revolution. Under Shah’s regime Pakistan enjoyed friendly relation with Iran as diplomatic relations between both countries were established in May 1948. Shah became the first head of state to visit Pakistan in March 1950. Security concerns played an important role in defining the relationship between two countries in early years. Iran’s major security concerns lie in West Asia especially in Persian Gulf region, whereas Pakistan’s security concerns revolve around its eastern neighbor India and Afghanistan. Security concerns play a decisive role in formation of regional alliances and formations  . Pakistan’s initial strategy was to maintain friendly relations with its neighbors but with India’s aggression in Kashmir and Afghanistan rejection to accept Pakistan since it didn’t accepted Durrand line. In these circumstances Pakistan couldn’t afford a hostile Iran as it wanted to garner more support especially, among Muslim countries in order to voice its concerns against India in the United Nations (UN).
As security concerns became crucial in devising the foreign policy for Pakistan the army became assertive as Pakistan faced political instability and uncertainty during 1950’s. With hostile neighbors India and Afghanistan, it became imperative for Pakistan to seek regional alliance to counter security challenges. Iran also witnessed political upheaval as Prime Minister Dr. Mohammed Mosaddeq nationalized the British Anglo-Iranian Oil Company (AIOC) with the approval of Iranian Parliament. This development led to the political crisis in Iran as Britain considered the act of Mosaddeq as hostile that would diminish the British commercial and strategic interests in Iran as AIOC enjoyed complete monopoly over production oil in Iran. Both United States (US) and Britain collaborated in bringing a coup in 1953 which removed the democratic Mosaddeq’s government and brought back the pro-west Shah’s regime back in Iran. 
After the removal of Mosaddeq by CIA sponsored action, Iran became closer to US while on the other hand neighboring Pakistan was already in cahoots with United States under the banner of Southeast Asia Treat (SEATO) with stated objective to contain Soviet communism. In the given context to further neutralize Soviet Union’s warm water ambitions, US crafted Baghdad Pact in 1955, which included Pakistan, Iran, Iraq, Turkey and United Kingdom, later renamed Central Treaty Organization (CEATO) after Iraq’s withdrawal. The purpose of this treaty was to create a model similar North Atlantic Treaty Organization (NATO) and promote mutual cooperation between member countries counter the Soviet threat in the region. Thus, during Shah’s era Pakistan and Iran invariably came closer, albeit through alignment of strategic interests and US backed treaties. Also they shared similar procedural approaches inside these treaties as both countries were the ones who persisted on common command structure being imposed on the CENTO army. 
The association between two weren’t limited on the security affairs but on the non-political front Regional Cooperation for development (RCD) was created in 1964 which Iran, Pakistan and Turkey later it was renamed Economic Cooperation Organization (ECO) in 1985.  The purpose of this tripartite agreement was to improve the mutual cooperation between the member countries in economic, cultural and other non-political affairs. Moreover, Iran always supported Pakistan in times of need which was evident in the 1965 Indo-Pak war where Iran expressed its concerns on the Indian aggression on many diplomatic forums as Iranian Foreign Minister declared that “Iran was concerned about India’s aggression against Pakistan, a fraternal Muslim Nation”.  On the other hand Iran also helped Pakistan militarily as Indian Defense Minister YB Chavan informed the Rajya Sabha on 2nd August 1965 that “besides China, Iran and Turkey were also supplying arms to Pakistan”. In addition, Shah extended his diplomatic support to Pakistan over Kashmir issue and stressed that Kashmir issue should be resolved on the basis of self-determination. 
RELATIONS AFTER THE IRANINAN REVOLUTION:
The Iranian revolution and the Soviet attack on Afghanistan in 1979 completely changed the dynamics of Iran-Pakistan relations. After the rise of an Islamist revolution in Iran the relations with US and other western countries were also dismantled as the new Islamic regime abandoned every policy associated with the Shah. The US lost its most dependable partner in the Middle-East region as major policy shifts took place as US sought new allies in the region. Therefore, Iran emerged as revolutionary state in Persian Gulf challenging the status-quo of the region and Pakistan became the frontline state in the American backed jihad against the Soviet invasion of Afghanistan.
After the revolution the Iran-Pakistan relations were on a low as the new regime led by Khomeini detests Pakistan for being close to Shah and western countries. On the other hand Pakistan handled the matters adeptly, as it was the first country to recognize the Iran revolutionary government. Pakistan sent a high-level delegation under the Foreign Minister to assure Iran that it wanted stable and bilateral relations with Iran. In addition to that, President Ziaul Haq visited Iran in 1980 to show a goodwill gesture and support for the new government. During the US hostages’ crisis Pakistan tried to convince US not to launch an offensive attack on Iran to end the crisis and recommended diplomatic means to resolve the crisis. Moreover, when the US broke diplomatic relations with Iran, a halt that has yet to be restored, the Pakistan’s embassy in Washington represents the interests of Iran in US under the Iranian Interests section. 
Pakistan also played critical diplomatic role during Iran-Iraq war. Pakistan tried to negotiate a deal between the two countries that could end the war. Pakistan provided moral support for Iran in many instances during the war which irked Iraq and Arab countries. Pakistan also made hectic efforts in convincing Saudi Arabia and other Arab countries to normalize their relations with Iran. During the war, Pakistan neutral stance served Pakistan’s interests of maintaining cordial relations with Arab world and also avoiding religious clash with Iran as there is sizable Shia population in Pakistan and Iran could have played Shia card in order destabilize Pakistan. 
The other factor discussed earlier which changed the dynamics of Iran-Pakistan relationship was the Soviet invasion of Afghanistan and the subsequent US backed jihad. The Americans saw Soviet aggression as a strategy to increase Soviet influence in Persian Gulf and Indian Ocean. The Soviet invasion brought a concurrence of interest between Pakistan and US. Pakistan with its proximity to Afghanistan was naturally chosen by the US to initiate a jihad against the Soviets in Afghanistan which brought the two countries into an alliance once again after the hiatus that emerged during Bhutto years. Pakistan’s strategic position also increased in US calculations as it lost Iran as a dependable ally in the region. From the perspective of Pakistan closer ties with US meant more US military aid and a golden opportunity for General Zia-ul-Haq in legitimizing his military dictatorship and improving his world image as a savior against the Soviet aggression.
The Soviet intervention in Afghanistan was a concern for Iran but it was grappling with other issues. As it was facing transformation from a revolution and its resources were concentrated against the Iraqi forces. So it could provide little material support for the Mujahedeen in Afghanistan. But relations between Iran-Pakistan deteriorated when they supported opposing governments after the Soviet withdrawal. The conflict between two countries was stemmed on the sectarian grounds, as Pakistan wanted a subservient Sunni-Pashtun government in Afghanistan but Iran was in favor of the Shias. This development led to the civil war between different factions of Mujahedeen to gain power in Afghanistan in 1992-94. Afghanistan’s security represents an important catalyst in the regional security paradigm, affecting overall security of the region, and sometimes even beyond. In this context, both countries need to comprehend that the intricate multiethnic fabric of Afghan society which consists of motley of ethnic groups including, but not limited to, Pashtuns, Tajiks, Uzbeks etc and taking sides in this conflict would eventually destabilize Afghanistan. The peace in Afghanistan is important as it connects oil rich Central Asian states which are landlocked; to seek a passage for goods or pipeline from these landlocked states, Afghanistan will act as an intermediary transit route so a peaceful Afghanistan is in interest for both Pakistan and Iran.
The relation between Iran and Pakistan became better under the leadership of a moderate Akbar Hashemi Rafsanjani who became the Iranian President in 1989 and remained in the power till 1997. Rafsanjani emphasized on bilateral relations between two countries based on economic cooperation after the war with Iraq drained all the Iran’s resources. The RCD which was renamed ECO in 1985 welcomed the newly independent Central Asian states in 1992, which opened new opportunities for Iran and Pakistan to deepen their economic ties and work together in achieving regional peace and prosperity.
RELATIONS IN RECENT TIMES:
Economic and business interests are becoming important aspects of the foreign policy of any country in the recent times. Today, a country doesn’t abandon trade relations with other country on the basis of political tension as world is becoming more and more interdependent. Iran and Pakistan despite being close neighbors have failed to reap the benefits of economic potential possessed by each country. But with the initiation of India, Pakistan and Iran (IPI) pipeline the economic ties are being cemented. Currently Pakistan is facing severe energy crisis and Iran with its vast oil and gas reserves can assist Pakistan in overcoming these crisis. Pakistan’s interests in Iranian gas are due to the increasing gap between the domestic demand and supply. According to the Oil and Gas Development Corporation (OGDC) Pakistan’s shortfall in 2010 would be 0.2 billion cubic feet per day (bcfd) which will increase to 1.4 bcfd by 2015 and 2.7 bcfd by 2020. The current load shedding of gas to industry is a result of these shortages. 
The proposed pipeline could provide an estimate of US$200 million a year in transit fee for Pakistan. The pipeline would connect the Asaluyed gas field in eastern Iran to Pakistan which would allow India to import about 2 billion cubic ft. of Iranian gas per day.  However, India has been delaying the project due to the security concerns and disagreement over transit fees, analysts also believe that India has been pressurized by the US to refrain from the project. Nevertheless, the Pakistani and Iranian authorities are keen to go ahead with the project even without India as Iran is considering China to replace India in the pipeline project. 
Another issue which has become a matter of global importance is the nuclear proliferation. Pakistan tainted nuclear scientist Dr. Abdul Qadeer Khan has been blamed for transferring nuclear technology to Iran. The suspicion became clear with the confession of Dr. Khan that he had provided assistance to Iran, Libya and North Korea in developing their nuclear arsenals. Though many doubts were cleared with the acceptance of Dr. Khan but it hadn’t been revealed that how Dr. Khan transferred the technology and who were the principal actors involved. Many scholars believe that Pakistan military which is also the guardian of Pakistan’s nuclear program fully backed the transfer of technology. 
The future of the Iran-Pakistan relations rests on the developments of the ‘New Great Game’. As Ahmed Rashid a noted scholar on Afghanistan believes that the ‘New Great Game’ Afghanistan involves many actors and conflicting interest.  With Pakistan support of Sunni-Pashtun Taliban regime in Afghanistan, Iran’s support for Northern alliance, India’s increasing presence in Afghanistan, China investing billions in economic programs and with NATO forces currently facing difficulties in fighting militancy in Afghanistan paints a complex and murky picture of Afghanistan. With the withdrawal of NATO in 2014 it would be important for these regional actors to come together and form policies that could insure regional prosperity and peace but most important avoid the situation that led to the civil war in Afghanistan in 1992-94 after the Soviet withdrawal.
The Pakistan-Iran relations have experienced many different ups and downs. Under Shah’s time both countries enjoyed relations based on trust and mutual cooperation but the relations faced severe blow after the Iranian revolution. In the recent times both countries face a huge challenge to develop relations based on mutual trust and cooperation, as both countries cannot deny the importance of each other in the region. The situation in Afghanistan is still hapless with rampant corruption and no infrastructure. Trade with Central Asian states still is very negligible as no concrete efforts were made on behalf of both countries to improve economic coordination, India’s presence in Afghanistan and increasing ties with Iran are cause of concern for Pakistan. There is an urgent need to create a regional block that involves India, Iran, Pakistan, Afghanistan and Central Asian states that could bridge the ties between these countries. All issues disturbing any member country must be addressed properly on the forum and concrete steps must be taken in order to implement the policy recommendations of the forum. A broad based and out of the box thinking is required in order to insure the economic and political stability of the region.