The Muslim-majority state of Pakistan 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 made up of two parts.
The break-up of the two wings came in 1971 when the Bengali-speaking east wing seceded with help from India to become the independent state of Bangladesh.
Development in Pakistan has been hampered by Islamist violence and economic stagnation, and relations with its key neighbours India and Afghanistan are often fraught.
ISLAMIC REPUBLIC OF PAKISTAN: FACTS
- Capital: Islamabad
- Area: 881,913 sq km
- Population: 242.9 million
- Languages: Urdu, English, Punjabi, Sindhi, Pashto, Balochi
- Life expectancy: 66 years (men) 68 years (women)
President: Arif Alvi
Arif Alvi is a long-standing member of the Tehreek-e-Insaf party, and has served two terms as a member of parliament.
He was elected by parliament in September 2018 to succeed Mamnoon Hussain, whose five-year term had come to an end.
Pakistan is a parliamentary republic where the prime minister wields most power, but presidents have often played key roles in constitutional crises.
Prime Minister: Shehbaz Sharif
The 70-year-old leader of the then opposition Pakistan Muslim League Nawaz, Shehbaz Sharif ousted former cricket star Imran Khan as prime minister in April 2022 in a parliamentary vote over Mr Khan's handling of the economy.
Mr Sharif is the younger brother of Nawaz Sharif, who served as prime minister on three occasions.
But unlike Nawaz, the new prime minister has cultivated good relations with the powerful military.
He served as chief minister of Punjab, Pakistan's most populous province, prior to Imran Khan coming to power in 2018, and won a reputation for efficiency.
Imran Khan and his Tehreek-e-Insaf party rode to victory on a pledge to end corruption and the role of political dynasties like the Sharifs, but critics accused him of appeasing Islamist extremists while failing to tackle economic stagnation.
The Himalayan region of Kashmir has been a flashpoint between India and Pakistan for over six decades.
Since India's partition and the creation of Pakistan in 1947, the nuclear-armed neighbours have fought two wars over the Muslim-majority territory, which both claim in full but control in part.
Today it remains one of the most militarised zones in the world. China administers parts of the territory.
Pakistan is one of the world's deadliest countries for journalists, with 14 media workers being killed in 2014 alone. Both intelligence agents and members of banned militant organisations are responsible for the threats to reporters, according to media watchdog organisations.
The government uses legal and constitutional powers to curb press freedom and the law on blasphemy has been used against journalists. Critics have raised concerns over the restrictive nature of a new code of conduct for broadcasters introduced in 2015.
Some key dates in Pakistan's history:
1947 - Muslim state of East and West Pakistan created out of partition of India at the end of British rule.
1948 - First war with India over disputed territory of Kashmir.
1971 - East Pakistan attempts to secede, leading to civil war. India intervenes in support of East Pakistan which eventually breaks away to become Bangladesh.
1999 - Army chief Pervez Musharraf seizes power in coup, ousting Prime Minister Nawaz Sharif.
2007 - Former Prime Minister Benazir Bhutto is assassinated while on campaign trail for 2008 parliamentary election.
2018 - Former international cricket star Imran Khan becomes prime minister on a pledge to end corruption and dynastic politics, but loses power four year later.