Foreign policy
The main feature of Ayub Khan's foreign policy was prioritizing relations with the United States and Europe. Foreign relations with the Soviet Union were downplayed. He enjoyed support from President Dwight Eisenhower in the 1950s and, working with Prime Minister Ali Khan, forged a military alliance with the United States against regional communism. His obsession towards modernization of the armed forces in the shortest time possible saw relations with the United States as the only way to achieve his organizational and personal objectives, as he argued against civilian supremacy that would affect American interests in the region as a result of an election.
The Central Intelligence Agency leased Peshawar Air Station in the 1950s, and spying into the Soviet Union from the air station grew immensely, with Ayub's full knowledge, during his presidency. When these activities were exposed in 1960 after a U-2 flying out of the air station was shot down and its pilot captured by the USSR, President Ayub was in the United Kingdom on a state visit. When the local CIA station chief briefed President Ayub on the incident, Ayub shrugged his shoulders and said that he had expected this would happen at some point.
Soviet Secretary General Nikita Khrushchev threatened to bomb Peshawar if the United States continued to operate aircraft from there against the Soviet Union. Ayub Khan apologised for the incident when he visited the Soviet Union five years later.
President Ayub directed his Foreign Office to reduce tensions with the Soviet Union by facilitating state visits by Soviet Premier Alexei Kosygin and Soviet Foreign Minister Andrei Gromyko and agreeing to downplay relations with the United States.
In 1963, Ayub signed the historic Sino-Pakistan Frontier Agreement with China despite US opposition.
During 1961–65, Ayub lost much of his support from President John F. Kennedy and President Lyndon Johnson as they sought closer relations with India. President Johnson placed an embargo on both nations during the war in 1965. Relations with the Soviet Union were eventually normalized when the Soviets facilitated a peace treaty between Pakistan and India in 1965, and reached a trade treaty with Pakistan the following year. In 1966–67, Ayub wrestled with the United States' attempt to dictate Pakistan's foreign policy, while he strengthened relations with the Soviet Union and China. Despite initiatives to normalize relations with the Soviet Union, Ayub Khan remained inclined towards the United States and the western world, receiving President Johnson in Karachi in 1967.
In 1961–62, Ayub paid a state visit to the United Kingdom. He attracted much attention from the British public when his involvement in the Christine Keeler affair was revealed.
In 1959, Ayub Khan's interest in building defence forces had already diminished when he made an offer of joint defense with India during the Sino-Indo clashes in October 1959 in Ladakh, in a move seen as a result of American pressure and a lack of understanding of foreign affairs Upon hearing this proposal, India's Prime Minister Jawaharlal Nehru reportedly countered, "Defence Minister Ayub: Joint Defence on what?" India remained uninterested in such proposals and Prime Minister Nehru decided to push his country's role in the Non-Aligned Movement. In 1960, President Ayub, together with Prime Minister Nehru, signed the Indus Waters Treaty brokered by the World Bank. In 1962, after India was defeated by China, Ayub Khan disguised a few thousand soldiers as guerillas and sent them to Indian Kashmir to incite the people to rebel. In 1964, the Pakistan Army engaged with the Indian Army in several skirmishes, and clandestine operations began.
The war with India in 1965 was a turning point in his presidency, and it ended in a settlement reached by Ayub Khan at Tashkent, called the Tashkent Declaration, which was facilitated by the Soviet Union. The settlement was perceived negatively by many Pakistanis and led Foreign Minister Zulfiqar Ali Bhutto to resign his post and take up opposition to Ayub Khan. According to diplomat Morrice James, "For them [Pakistanis] Ayub had betrayed the nation and had inexcusably lost face before the Indians."
According to Sartaj Aziz, deputy chairman of the Planning Commission, it was Foreign Minister Bhutto who had inadvertently set Pakistan on the road to war with India. During a cabinet meeting, Bhutto had gone on a populist anti-Indian and anti-American binge and succeeded in spellbinding President Ayub into thinking he was becoming a world statesman fawned upon by the enemies of the United States. When Ayub authorized Operation Gibraltar, the fomenting of a Kashmiri insurgency against India, Aziz famously told the President: "Sir, I hope you realise that our foreign policy and our economic requirements are not fully consistent, in fact they are rapidly falling out of line". Aziz opposed Operation Gibraltar, fearing the economical turmoil that would jolt the country's economy, but was in turn opposed by his own senior bureaucrats. In that meeting, Foreign Minister Bhutto convinced the president and the finance minister Muhammad Shoaib that India would not attack Pakistan due to Kashmir being a disputed territory, and per Bhutto's remarks: "Pakistan's incursion into Indian-occupied Kashmir, at [A]khnoor, would not provide [India] with the justification for attacking Pakistan across the international boundary because Kashmir was a disputed territory." This theory proved wrong, when India launched a full-scale war against West Pakistan in 1965.
Chief of the Army Staff General Musa Khan held off launching Operation Grand Slam, waiting for President Ayub Khan's go ahead. The operation didn't get underway until after the Indian Army had captured Haji Pir pass in Kashmir. He faced serious altercations with, and public criticism from, air chief Air Marshal Asghar Khan for hiding the details of the war. The Air Headquarters began fighting the president over the contingency plans, and this inter-services rivalry ended with Asghar Khan's resignation.
About the 1965 war's contingency plans, Air Marshal Nur Khan briefly wrote that "Rumours about an impending operation were rife but the army had not shared the plans with other forces."
Ayub Khan's main sponsor, the United States, did not welcome the move, and the Johnson administration placed an economic embargo that caused Pakistan to lose US$500 million in aid and grants that had been received through consortium. Ayub Khan could not politically survive in the aftermath of the 1965 war with India and fell from the presidency after surrendering presidential power to Army Commander General Yahya in 1969.
Afghanistan
In the 1950s, partly due to the complicated bilateral relations between Afghanistan and Pakistan over the Durand Line dispute, Ayub Khan along with the Royal family of Afghanistan under King Zahir Shah proposed the Afghanistan-Pakistan Confederation Plan to merge Afghanistan with Pakistan under a single confederation. This merger was proposed on the basis of mutual distrust and fears of security threats by the Indian government and the Soviets, which wasn't able to amount to fruition due to the eventual Soviet invasion of Afghanistan and the formation of a new communist Afghan regime.