More than 200 million Pakistanis marked the 70th anniversary of independence on Monday with the country facing challenges ranging from terrorism to political scandal to border tensions with both India and Afghanistan.
Celebrations began at the stroke of midnight with fireworks displays in major cities. A 31-gun salute was held in capital Islamabad and cities, towns and villages were decorated with green and white flags and posters of national heroes.
The air force was also set to host Pakistan's largest air show to date, with fighter jets and bombers on display.
Special prayers were offered and President Mamnoon Hussain, Prime Minister Shahid Khaqan Abbasi and Chinese Vice Premier Wang Yang presided over a flag-raising ceremony at Parliament House.
At the highly symbolic Wagah border crossing with India, army chief General Qamar Javed Bajwa raised a massive national flag on a 400 foot-high pole as crowds chanted patriotic slogans.
Following the chest-pumping performance Bajwa said the country was making progress and promised to "go after each and every terrorist in Pakistan".
"We have made a few mistakes in the past, but we are on the road to development under the guidance of our constitution," he added.
A powerful bomb targeted a military vehicle in the restive capital of Balochistan province late Saturday, killing 14 people including several troops.
The military later said the blast, which was claimed by the Daesh group, was intended to mar Independence Day celebrations.
Pakistan is facing serious challenges, many of them stretching back to the creation of the state on Aug. 14, 1947, when it was parted from India at the end of 150 years of British rule.
Partition is recognized as the largest and bloodiest migration of the last century. Fifteen million people were uprooted from their homes and around 2 million died in sectarian killings or from hunger or disease.
Hindus and Sikhs were forced to flee what became Pakistan while Muslims were expelled from India.
It nourished a deep-rooted mutual antipathy between the two sides that still exists today and led to two fully-fledged but inconclusive wars -- in 1948 and 1965 -- over the Muslim-majority Himalayan Kashmir valley.
The Kashmir issues remains a burning source of contention between Islamabad and New Delhi, with regular artillery duels and skirmishes along the Line of Control dividing the Indian and Pakistani territory.
The two neighbors also fought in 1971 over the secession of East Pakistan, now Bangladesh.
On Pakistan's northern border, the battle against the Taliban and its affiliates in the northwestern tribal belt provides another source of tension.
The "war on terror" has resulted in more than 50,000 deaths, including more than 5,000 troops, since 2002, as well as costing an estimated $100 billion-plus to the Pakistani economy.
It has led to deteriorating relations with the government in Kabul, particularly in recent months, with both sides alleging each other has supported cross-border terrorism.
Such allegations have dragged in the U.S., a long-term ally of Pakistan since the Cold War when the relationship was sealed during the anti-Soviet campaign in Afghanistan in the 1980s.
Washington has even suggested sanctions against Islamabad "if it continues to provide the alleged support and sanctuary to terrorist and insurgent groups" operating against Afghanistan.
Amir Rana, an Islamabad-based security analyst, told Anadolu Agency that Pakistan was faced with a number of delicate security and diplomatic challenges.
Ideological support for some militant groups among Pakistanis could help them re-establish bases in the tribal regions that the military has fought hard to uproot, Rana said.
He added: "To eliminate this ideological support for militants is the biggest challenge for us."
Rana, the director of the Pak Institute for Peace Studies, said improved relations with Kabul would lead to the restoration of close ties with the U.S.
The precarious balance between civilian and military power has been a constant thread in Pakistan's history.
The military -- the sixth largest in the world with more than 600,000 personnel -- has ruled Pakistan for half its existence, a period during which one prime minister has been hanged and two assassinated.
None of the 17 elected premiers have been able to complete their terms in office since 1947, including three-times Prime Minister Nawaz Sharif, who was sacked by the Supreme Court following an investigation into corruption allegations against his family.
Sharif's forced resignation was seen by many as evidence of further military meddling in politics.
"Civil-military relations is a structural issue, which has been plaguing Pakistan for last 70 years," Rana said. "It needs to be resolved once and for all.
"Until this issue is resolved, there will be no permanent political structure in Pakistan and it will continue to hamper the country's political, social and economic growth."
Despite this apparent instability, Kaiser Bengali, one of the country's most distinguished economists, said Pakistan's democratic institutions have grown stronger since the turn of the millennium.
"This is the third consecutive parliament which is going to complete its tenure since 2002," he told Anadolu Agency.
"No doubt, the army has had problems with the prime ministers but I don't think democracy or the parliament is under threat."
However, the economic outlook remains "precarious", according to Bengali.
"Rising poverty is a very serious challenge, which must be addressed on a war-footing basis through effective and corruption-free economic policies," he said.
Nearly 30 percent of the population lives below poverty line -- around 55 million people -- according to the Ministry of Planning and Development.
Pakistan also faces rising balance of payment and trade deficits.
"Our imports are increasing whereas exports are either decreasing or stagnant for last several years," Bengali said. "This all is posing a further threat to our already dismal economy."