Over the next several thousand years, the region would develop into various civilizations like Mehrgarh and the Indus Valley Civilization. Prior to the independence of Pakistan in 1947, modern-day Pakistan was part of the medieval and subsequently of colonial India.Throughout its history, the region has been also been a part of various other kingdoms like Indian, Greek, Mongol, Persian, Turkic, Araband British. The region's ancient history also includes some of the oldest empires from thesubcontinent and some of its major civilizations. The political history of the nation began with the birth of the All India Muslim League in 1906 to protect Muslim interests, amid fears of neglect and under-representation of Muslims, in case the British Raj decided to grant local self-rule. On the 29 December 1930, Sir Muhammad Iqbal called for an autonomous state in "northwestern India for Indian Muslims". The Muslim League rose to popularity in the late 1930s. Muhammad Ali Jinnah espoused the Two Nation Theory and led the Muslim League to adopt the Lahore Resolution of 1940, demanding the formation of independent states for Muslims in the East and the West of British India. Eventually, a united Pakistan with there wings-Pakistan]] and East Pakistan - gained independence from the British, on 14 August 1947. Modern-day Pakistan came in existence in 1971, after a civil war in the distant East Pakistan and emergence of an independent Bangladesh.
Independence from the British Raj witnessed unprecedented and prolonged communal riots eventually resulting in millions of Muslims migrating to Pakistan and millions of Hindus and Sikhs migrating to India. The Hindu Maharaja of princely state of Kashmir which itself is a Muslim-majority region was hesitant to accede to India or Pakistan although negotiations continued between Maharaja and both India and Pakistan. The Maharaja started unarming the Muslim soldiers in his militia and the police. Foreseeing the results of this, a group of Kahmiri Muslims took up arms against the Maharaja. As they ran short of weapons the freedom fighters asked the Pashtun tribals for help. Maharaja requested India for forces to help crush the rebellion however India refused to send forces until Maharaja decided on accession. On 25 October the tribals were close to the capital Srinagar hence Maharaja signed instrument of accession with India. Based on instrument of accession Kashmir became part of India and on 26 October the Indian forces were airlifted to Srinagar to defend it from foreign militia. Since the armed rebellion was unlikely to succeed in face of Indian army Pakistan decided to send its regular forces, however the British General of Pakistan armed forces refused to send regular troops saying that he was subject to permission from Mountbatten the Governor General of India, the unorganized tribals were forced out of Srinagar by the heavily armed Indian forces, whereas they retained control of what became Pakistan Administered Kashmir. Pakistan refused to grant General Gracey an extension and perceived it good to appoint a Pakistani General as head of the armed forces. LOC demarcation done in 1949 stopped till point NJ 9842 shot of marking position around the Siachen Glacier. In 1984, backed by the Soviet Union to exert pressure on Pakistan stop the assistance to Afghan Mujahideen, India sent forces in Siachen Glacier, where they remain to this day. India controls 80% of Siachen Glacier while the other 20% of Siachen Glacier and the whole of Baltoro Glacier is controlled by Pakistan. Siachen is the highest battleground in the world.
Pakistan declared itself an Islamic republic on adoption of a constitution in 1956, but the civilian rule was stalled by the 1958 military coup d'etat by Ayub Khan, who ruled during a period of internal instability and a second war with India in 1965. Economic grievances and political dissent in East Pakistan led to violent political tensions and army repression, escalating into civil war followed by thethird war with India. Pakistan's defeat in the war ultimately led to the secession of East Pakistan and the birth of Bangladesh.
Civilian rule resumed from 1972 to 1977 under Zulfikar Ali Bhutto, until he was deposed by General Zia-ul-Haq, who became the country's third military president. Pakistan's secular policies were replaced by the Islamic Shariah legal code, which increased religious influences on the civil service and the military. With the death of Zia-ul-Haq in 1988, Benazir Bhutto, daughter of Zulfikar Ali Bhutto, was elected as the first female Prime Minister of Pakistan. Over the next decade, she alternated power with Nawaz Sharif, as the country's political and economic situation worsened. Military tensions in the Kargil conflict with India were followed by a 1999 coup d'état in which General Pervez Musharraf assumed executive powers. This occurred due to the defeat of Pakistan by India in Kargil and the economic hardship that followed after the Kargil conflict.
In 2001, Musharraf named himself President after the resignation of Rafiq Tarar. In the 2002 Parliamentary Elections, Musharraf transferred executive powers to newly elected Prime Minister Zafarullah Khan Jamali, who was succeeded in the 2004 by Shaukat Aziz. On 15 November 2007 the National Assembly completed its term and a caretaker government was appointed with the former Chairman of The Senate, Muhammad Mian Soomro as Prime Minister. Following the assassination of Benazir Bhutto, that resulted in a series of important political developments, her husband Asif Ali Zardari was eventually elected as the new President in 2008.