Foreign relations of Pakistan

Pakistan is the second largest Muslim country in terms of population (behind Indonesia). Pakistan is the only Muslim country known to have nuclear weapons. Pakistan is also an important member of the Organization of the Islamic Conference (OIC).
Pakistan is an active member of the United Nations. Pakistan had some problems with its Foreign relations. Pakistan's relations with its neighbor, India is ok, but mostly not good. Both countries have been fighting over the disputed territory of Kashmir,over which they have fought two to three wars. Pakistan has also had difficult relations with neighbors Afghanistan and Iran. Pakistan has had a long and good relationship with the China. Pakistan has interest over the Persian Gulf and has wide-ranging bilateral relations with the United States and other Western countries.
Pakistan distrusted the Soviet Union during much of the Cold War. Because of this Pakistan had strong relations with both the United States of America and the People's Republic of China. 
Pakistan was a member of the American-sponsored CENTO and SEATO military alliances. Pakistans' alliance with the United States was especially close after the Soviets invaded the neighboring country of Afghanistan. In 1964, Pakistan signed the Regional Cooperation for Development (RCD) Pact with Turkey and Iran, when all three countries were closely allied with the U.S., and as neighbors of the Soviet Union, wary of perceived Soviet expansionism. To this day, Pakistan has had a close relationship with Turkey. RCD became defunct after the Iranian Revolution, and a Pakistani-Turkish initiative led to the founding of the Economic Cooperation Organization (ECO) in 1985. For several years, Pakistan's relations with the Republic of India had been gradually improving, which opened up Pakistan's foreign policy to issues beyond security.