Pakistani Prime Minister Nawaz Sharif. (Reuters/Public Transport Victoria)

In May 2013 after his electoral victory, Nawaz Sharif said something that for years, no Pakistani leader had dared to express. Sharif told me, “civilian supremacy over the military is a must.” He went a step further and said, “The prime minister is the boss, not the army chief. This is what the constitution says. We all have to live within the four walls of the constitution.”

This week, Pakistan’s Supreme Court disqualified Sharif for life, ostensibly because his three children were named in the Panama Papers and were charged with having undeclared properties abroad through offshore companies. Ultimately, he was found guilty on a technicality unrelated to the Panama Papers.

But was Sharif’s dismissal written into the script the day he asserted his civilian rights? Sharif seems to be paying the price for trying to restore some authority to the office of the prime minister. He also took on a foreign policy agenda that was inimical to the shadowy Pakistani security establishment that has often used terrorist groups as strategic assets against both India and Afghanistan. Earlier this year, amid spiraling tensions between India and Pakistan,  Sharif told me he was attempting a renewed rapprochement; his India policy is certainly one reason why he was disliked by his army.

Sharif’s ouster is being celebrated by some as an example of Pakistan upholding the best democratic values of accountability. “It’s the biggest victory for the rule of law in Pakistan’s history,” said Naeem Ul-Haque, of the opposition party Pakistan Tehreek-e-Insaf (PTI). Haque is an aide to glamorous cricketer-turned politician Imran Khan — the main petitioner in the case demanding action against Sharif. “Rule of law is the spirit of democracy,” Haque insisted.

In fact, this verdict is the exact opposite. It weakens the country’s tenuous democracy and allows its all-powerful army to grab power without having to formally seize it. Pakistan’s Supreme Court did not even permit Sharif the benefit of a legal trial, accepting instead the findings of an investigative panel, on which two of the six members were from the same military establishment that wanted his exit. “This is a judicial coup,” Husain Haqqani, Pakistan’s former ambassador to the United States, said to me in an interview. “Had this been about corruption, there would have been a trial, not direct intervention by the Supreme Court, which should only be the court of final appeal in criminal matters. The military in Pakistan knows the difficulties of a military coup, so now hidden powers are using the judiciary.” The Supreme Court of Pakistan has validated previous military coups citing what it calls the “doctrine of necessity.”

Indeed, in Pakistan, the military is the ventriloquist and politicians are the puppets. No elected prime minister has completed a full term.

When Sharif won in 2013, it was the first peaceful transition of power from one elected government to another. But even Sharif’s predecessor and opponent, Asif Ali Zardari, had to live with his government’s prime minister being ousted by the Supreme Court. Sharif himself has been sacked twice before as prime minister; in 1993, he was ousted by the president, and in 1999, his army chief, Gen. Pervez Musharraf, seized power in a brazen takeover. Musharraf’s hijacking of the government was the third successful army takeover in Pakistan. Since then, many Pakistanis have argued that their nation is “post-coup.”  Sharif’s ouster proves that claim is a lie.

Sharif’s  has been sent home — not because of  “Panama Gate” but because, believe it or not, he failed to be “sadiq” and “ameen,” or truthful and trustworthy. These vaguely worded criteria, borrowed from Arabic, were brought into law by another military dictator, Gen. Zia-ul-Haq, under the contentious clauses of Articles 62 and 63 of Pakistan’s constitution. A godsend for military authoritarianism, these arbitrary provisions are meant to benchmark morally upright leaders and disqualify them if needed. Sharif, the court says, was untruthful about not drawing a salary of 10,000 dirhams a month (about $2,700) as chairman of a Dubai-based company (Capital FZE) owned by his son, until nearly a year after assuming office. Sharif’s lawyers argued that this involved an Emirati work permit procured during the years Musharraf forced him into exile. Investigators insist Sharif did not declare this additional income; the former Prime minister argued that he never used the money.

Now contrast these relatively small charges with Musharraf,  who stands accused of high treason as well as having a role in the murder of Prime Minister Benazir Bhutto. The military weighed in, and Musharraf was allowed to leave the country with the permission of the courts.

This glaring double standard is what undermines Pakistan’s democracy. “It is a populist judgment, which has opened the doors for the disqualification of politicians on flimsy grounds,” warns Asma Jahangir, one of Pakistan’s most respected lawyers. “It is highly flawed in procedure and substance.” Jahangir told me she understands the concern over corruption and conceded that the Sharif family — with huge business interests in steel and sugar — would have to address these questions, but added: “What  is the hurry; why the short cuts? He has a right to due process.”

Sharif’s political opponents, such as Khan, may be rejoicing at his ouster. But Pakistani friends say he should know that this verdict sets a dangerous precedent. Tomorrow it could be Khan.  Pakistanis speak of the army’s “Minus-3 Formula,” meaning that the military has already pushed three major national leaders — Altaf Hussain, Sharif and Zardari — into oblivion.   It’s official: Pakistan’s military no longer needs martial law to control the nation.