Pakistan in the Iran–Iraq War

During the 1980s Iran–Iraq War, the foreign policy of Pakistan played a complex role in the war.

According to the national security experts, the role of Pakistan in the war, however, was based more on maintaining a delicate balance. During the conflict, Pakistan sought to portray as strictly "neutral" but cultivated friendly relationship with Iran. In a state visit paid by Pakistani President General Zia-ul-Haq to the United Kingdom in the mid-1980s, he correctly predicted that the conflict "will end up in a military stalemate".

Overview
The Pakistani military initiated a covert regime change action under Chief of Army Staff General Zia-ul-Haq and Chief of Naval Staff Admiral Mohammad Shariff by imposing martial law in all of the country in 1979. In 1980, the Iranian Revolution, led by Ayatollah Khomeini, evoked a strong reaction throughout the Muslim world. The spillover of the revolution worried the Arab world, as well the military government of Pakistani President General Zia-ul-Haq.

His religiously-influenced military government provided a rare opportunity, and the political change in Pakistan and the Islamic Revolution in Iran suited well to both countries and so no diplomatic or political rift occurred between them. Responding swiftly to the great revolutionary change, Pakistani Foreign Minister Agha Shahi immediately paid a state visit to Tehran and met Iranian Foreign Minister Karim Sanjabi on 10 March 1979. Both countries expressed confidence by stating that they would march together to a brighter future. The next day, Agha Shahi held talks with Ruhollah Khomeini in which developments in the region were discussed.

On 11 April 1979, Zia famously declared, "Khomeini is a symbol of Islamic insurgence". Reciprocating President Zia's sentiments, Imam Khomeini in his letter called for Muslim unity and declared, "Ties with Pakistan are based on Islam." By 1981, Zia-ul-Haq was close allies with the United States again and came under the latter's sphere of influence for a long time.

In 1980, Iraqi President Saddam Hussein decided to invade Iran. Pakistan immediately deployed its military contingent to protect the Gulf states against the Iranian threat by placing about 40,000 military personnel in Saudi Arabia for security and training purposes.

Reportedly, Pakistan also began to supply conventional weapons to Iran, and both neighbours supported the Afghan jihad against the Soviet Union but different factions of the resistance.

Military assistance and co-operation increased in support to Iran, and Pakistan never openly supported Iraq during the Iran-Iraq War despite tremendous pressure from the United States and Saudi Arabia. There are reports of Pakistan financially helping Iran at the operational level. The Pakistani military officials strongly objected killing of Iranian pilgrim riot by the Saudi Arabian Army on the annual Hajj pilgrimage to Mecca in 1985. Conversely, Pakistan exported and sold numbers of Chinese and US weapons to Iran, specifically the Silkworm and Stinger missiles which proved to be a crucial integrating factor in the Tanker War; they had originally been bounded for the Afghan mujahideen against the Soviets.