Karachi, Pakistan: The last time Nawaz Sharif led Pakistan, he spent two years in office before the military kicked him out. More than a decade later, it’s unclear if he’ll last that long.

Sharif’s opponents, led by opposition leader Imran Khan, accuse him of rigging last year’s election and say they won’t stop protesting in front of parliament until he goes. His supporters say he won a flawed but fair election, and view those calling for his ouster as elites who favour authoritarianism.

In the middle is the military, an institution that has prevented Pakistan from falling into the hands of Islamic militants such as those in Syria and Iraq even while stifling democracy for most of its 67-year history. The fact that the army has stayed on the sidelines so far represents progress, according to Ikram Sehgal, a former military official.

“The army flatly refusing to come in is a great victory for the democratic process,” Sehgal, chairman of the Pathfinder Group, one of Pakistan’s largest security companies, said by phone. “The politicians are sorting out the process.”

At stake is the government’s ability to meet the conditions of a partially disbursed International Monetary Fund loan and stay focused on fighting off Taliban insurgents along the Afghan border. The nuclear-armed country of 196 million people has received billions of dollars in US aid to fight militants seeking to implement a strict version of Islamic Sharia law.

Sharif, 64, became prime minister for the third time last year, with his party winning 122 out of the 268 seats contested in the election, about four times his nearest rival. The vote marked the first transfer of power between elected governments since the country was founded in 1947.

Khan, 61, saw his Tehreek-e-Insaf control 10 per cent of parliamentary seats after the election, making it the third largest. The former cricket star has accused Sharif of rigging the vote in his favour and personally benefiting from his position of power.

After Khan saw his election fraud complaints thrown out by Pakistan courts, he decided to pressure Sharif on the streets. Last week, he joined forces with religious cleric Muhammad Tahirul Qadri to rally tens of thousands of supporters to go on a long march from Lahore to Islamabad. They have camped out since, demanding that Sharif step down even as their numbers dwindle.

The military “will have to invoke some dressed-up doctrine of necessity in the name of public law and order to eject him,” Burzine Waghmar, an academic at the Centre for the Study of Pakistan at the School of Oriental and African Studies in London, said in an email. “It really comes down to what arrangement Sharif has reached with the army chief.”

During his 15 months in office, Sharif has differed with the military over talks with Taliban insurgents and pursued a case against Pervez Musharraf, the general who ousted him in 1999. He has also increased the army’s budget by 12 per cent in the interim budget in June to counter neighbouring India’s rising military power.

Sharif this week authorised the military to prevent protesters from entering a restricted part of Islamabad that included parliament and his residence. Soldiers and riot police didn’t stop Khan and his protesters two days ago as they entered the zone, where they currently remain.

Army chief Raheel Sharif on Aug. 20 called for “meaningful” talks between the government and protesters after meeting with Shahbaz Sharif, chief minister of Punjab and the prime minister’s brother. The prime minister and army chief aren’t related.

The two sides have met since, with Khan keeping his demand that Sharif step down. The prime minister yesterday received the backing of almost all parties for a parliamentary resolution rejecting Khan’s demand that Sharif resign. Those opposed included Musharraf’s party.

“If Sharif does step down then it will mean that the army has actually intervened,” Harris Khalique, an independent political analyst based in Islamabad and a columnist for The News International. “If he doesn’t, it will mean they won’t.”

Pakistan’s benchmark KSE100 Index of stocks has risen 1.3 per cent since Khan began protesting on Aug. 14, after falling 3 per cent in the prior week. The rupee has dropped 1.4 per cent in that time to its lowest level since March 10.

“If this demonstration leads to any sort of intervention by the military, it nullifies everything PTI has done,” Vahaj Ahmed, head of research at Topline Securities in Karachi, said by phone, referring to Khan’s Tehreek-e-Insaf political party. “This is one thing that will probably hold back Khan’s party from taking drastic action.”

Khan’s supporters insist they are fighting for democracy and don’t want the military to get involved. His party Thursday accused the United States of interfering after State Department spokeswoman Marie Harf said the US doesn’t support “extra- constitutional changes” in Pakistan.

“Our protest is democratic and constitutional and it is unacceptable for an external power to intrude into the internal political dynamics of Pakistan, especially when it is going through a crisis,” the party said in a statement.

While Pakistan’s elections last year lacked transparency and were vulnerable to malpractice, they were “significantly improved,” the European Union said in a report on the vote. The EU, which sent observers to the country, said the election had high levels of competition and an increase in voter turnout.

“If Sharif is forced out by a few thousand protesters after being elected with millions of votes, it would mean that Pakistani democracy remains subject to the whims of the military and its civilian allies,” Husain Haqqani, a former Pakistani ambassador to the United States and a fellow at Hudson Institute in Washington said in an email. “The winner would be Pakistan’s authoritarian tradition. The loser would be the idea of a democratic Pakistan.”