ISLAMABAD -- Although Pakistanis have suffered immensely from violence and terror over the past 15 years, the situation has failed to derail their support of democracy, analysts say.
Between 2003 and January 2017, some 21,526 civilians and 6,600 soldiers were among the total 61,545 people killed in attacks across the country, according to the South Asia Terrorism Portal. The remaining number, over 33,000, were militants and terrorists.
This violence has taken an immense toll on Pakistanis, as well as on the country's economy, politics, culture and international relations.
In addition to the tens of thousands of lives destroyed by terrorism, Pakistan lost at least Rs. 12.3 trillion ($118 billion) during the on-going war on terror, Finance Minister Ishaq Dar said last year.
Terrorism wrought destruction nationwide -- ravaging infrastructure in the north and financial hub Karachi and Balochistan in the south.
Yet the public, even as it endured bombings and massacres, rejected other possibilities like strongman rule and united behind democracy.
"Terrorism and dictatorship in Pakistan not only created difficulties for the government but affected the international image of Pakistan, which in turn damaged investment, trade, the economy and above all respect for the country," Imtiaz Gul, director of the Islamabad-based Centre for Research and Security Studies, told Pakistan Forward.
"No doubt the suffering was massive and contributed to a consensus on democracy," he said.
Pakistanis endured great violence during the presidency of Gen. Pervez Musharraf, who ousted the democratically elected Pakistan Muslim League-Nawaz (PML-N) government in 1999 and remained in power until 2008, Gul said.
Between 2004 and 2009, terrorism and violence in Pakistan increased and the Musharraf-led government failed to stop the Taliban from capturing Swat and the tribal areas along the Afghan border, according to media reports.
During this time, Pakistan's difficulties grew and it became evident that defeating militants without democracy in place was impossible, said Gen. (ret.) Talaat Masood, a security analyst in Islamabad.
Gen. Ashfaq Pervez Kayani, army chief from 2007 to 2013, postponed a long-sought counter-insurgency offensive in North Waziristan because he wanted democratic consent for the decision, Masood said. The tribal agency was the main base of Pakistani militants.
Kayani's successor, Gen. Raheel Sharif , "launched Operation Zarb-e-Azb [in June 2014 in North Waziristan] after receiving unanimous backing from the political parties", Masood added.
Only democracy can drive down violence in Pakistan, said Tahir Khan, an Islamabad journalist who writes about terrorism and the Taliban.
"The casualties and suffering of civilians caused political parties and players to form a consensus on the need for democracy," he told Pakistan Forward.
Past Pakistani leaders like Gen. Muhammad Zia-ul-Haq (in power 1978 to 1988) ruled by force and left the country worse off, citizens say.
The country has had three coups since gaining independence in 1947.
"We had not observed massive sectarian violence and polarisation in Pakistani society before Gen. Zia-ul-Haq's era, factors that eventually contributed to violence in the country," said Jabbar, 65, a senior citizen from Islamabad.
Internal and external factors contributed to a democratic Pakistan, said Zahir Shah, a political scientist at Abdul Wali Khan University in Mardan.
"This recent consensus on democracy is an unprecedented development in the country, ruled by dictators for a long time, and such a move will affect the culture and society in Pakistan in the long run," he told Pakistan Forward. "We will see several other democratic changes ahead."
Such changes could include the strengthening of institutions and of the rule of law. For example, 2013 marked the first time that a civilian Pakistani government completed its full five-year term.
Previously, some politicians and parties supported military intervention because it suited them and their goals, Gul said.
However, most political parties realise that instability allowed terrorism to surge and that democracy is the only way to end the violence, observers argue.
"Democracy has gradually discouraged terrorism and extremism," Masood said.
How effective will the future fence along the Pakistan-Afghanistan border be in controlling the movement of militants?