The Muslim-majority state of Pakistan occupies an area which was home to some of the earliest human settlements and where two of the world's major religions, Hinduism and Buddhism, were practised.
The modern state was born out of the partition of the Indian sub-continent in 1947 and has faced both domestic political upheavals and regional confrontations.
Created to meet the demands of Indian Muslims for their own homeland, Pakistan was originally in two parts.
The east wing - present-day Bangladesh - is on the Bay of Bengal bordering India and Burma. The west wing - present-day Pakistan - stretches from the Himalayas down to the Arabian Sea.
The break-up of the two wings came in 1971 when the mainly Bengali-speaking east wing seceded with help from India.
The disputed northern territory of Kashmir has been the flashpoint for two of the three India-Pakistan wars - those of 1947-8 and 1965. There was a further brief but bitter armed conflict after Islamic militants infiltrated Indian-administered Kashmir in 1999.
Military Dominance
Civilian politics in Pakistan in the last few decades has been tarnished by corruption, inefficiency and confrontations between various institutions. Alternating periods of civilian and military rule have not helped to establish stability.
Pakistan came under military rule again in October 1999 after the ousting of a civilian government that had lost a great deal of public support.
The coup leader, General Pervez Musharraf, pledged to revive the country's fortunes, but faced economic challenges as well as an increasing polarisation between Islamist militancy and the modernising secular wing of Pakistani politics.
Under growing pressure to reintroduce democratic rule, Mr Musharraf relinquished his army post in November 2007, but at parliamentary elections in February 2008, his supporters were defeated by the opposition Pakistan People's Party and former PM Nawaz Sharif's Muslim League.
The two parties formed a coalition government and an impeachment process was launched against Mr Musharraf, who resigned in August 2008.
Border Tensions and Terror
However, Pakistani forces have struggled to maintain control over the restive tribal regions along the Afghan border, where Taliban-linked militants became firmly entrenched.
Since 2009, the government has been waging an on-and-off military campaign to flush the militants out of the tribal areas.
It has repeatedly denied US and Afghan allegations that senior Al-Qaeda and Taliban leaders are present in the wild border areas, or that its intelligence service ISI even has links to militant groups operating against the Afghan government.
Tensions with India over Kashmir have resurfaced regularly ever since the partition of the sub-continent, and the two nuclear-armed powers have on numerous occasions been on the brink of renewed conflict.
India has accused Pakistan of failing to cooperate adequately over the investigation into the November 2008 extremist attacks in Mumbai, and has halted talks on improving relations