Pakistan and Iran have a long history of close relations since Pakistan's establishment in 1947. Iran was the first country to recognize Pakistan and the two countries signed a treaty of friendship in 1950. They have supported each other both militarily and economically over the years, including during the 1965 and 1971 Indo-Pakistan wars. While relations faced some difficulties during the Soviet-Afghan war and rise of the Taliban, the countries have worked to rehabilitate ties in recent decades. They continue economic cooperation like on a proposed Iran-Pakistan gas pipeline and aim to strengthen security cooperation along their shared border.