Pakistan's General Election is to be held on Wednesday after former prime minister Nawaz Sharif was deposed, banned from contesting for political office and finally, arrested. This is only going to be the second democratic transition of power in Pakistan's fraught 71-year history. So we're still learning.

But by all accounts, we're not learning fast enough. Islamabad High Court judge Shaukat Siddiqui has rather sensationally accused the ISI of meddling with judicial processes and declared that the intelligence agency doesn't want Nawaz and his daughter Maryam out of jail until the elections are over. Siddiqui has clashed with the army before and his remarks prompted an immediate response from ISPR chief Asif Ghafoor, who asked the Chief Justice of Pakistan Saqib Nisar to take legal notice of a national institution being maligned — which the chief justice has since done.

In fact, he's not just reassured the army's public relations wing, he's bizarrely gone as far as to say that the high court justice will soon be served some justice himself. This is the same chief justice who called Nawaz's Pakistam Muslim League-Nawaz (PMLN) a Sicilian mafia, so he has a flare for the dramatic.

Siddiqui is currently embroiled in a corruption reference filed against him by the Capital Development Authority (CDA) for allegedly having his home renovated at the state's expense. In 2017, he was making headlines when he questioned the military playing the role of mediator between the Punjab government and firebrand cleric Khadim Hussain Rizvi when he announced street blockades over — but not limited to — the rewording of a parliamentary oath that excommunicates Ahmadi Muslims.

Tehreek-e-Labbaik held entire cities hostage with little security resistance. Arrest warrants were issued against Rizvi that weren't acted upon and here he is now, contesting the elections. When asked why the Punjab government seemed helpless against the machinations of one cleric, the former provincial law minister Rana Sanaullah claimed that some 'khalayi makhlooq' was stopping the police from doing its job — where 'khalayi makhlooq' was a polite euphemism for the ISI. To complete the circus act, a man in uniform was caught on film handing out money to end the sit-in against the Punjab government.

Tehreek-e-Labbaik has nominated over 500 candidates in the election despite the arrest warrants and terrorism charges against Rizvi. Prompting many to ask why the security establishment is letting him contest the ballot and not veteran politicians affiliated with the PML-N; politicians who claim the nuisance value of these clerics in Punjab is meant to make small dents into PML-N's vote bank.

Siddiqui is also the judge who wanted to try former military dictator Pervez Musharraf on terrorism charges during his dispute with then Chief Justice Iftikhar Muhammad, when many judges were arbitrarily dismissed and placed under house arrest. Musharraf was indeed tried for treason and has since fled to Dubai. Siddiqui openly questioned why his name was struck off the Exit Control List while the Islamabad High Court was still summoning him to court

Currently in Adiala Jail, Nawaz has reportedly been in some medical distress and there are unconfirmed reports now that he may be moved to a house arrest situation where better medical care can be given. Earlier this month, Nawaz was in London visiting his wife Kulsoom who has been in considerable medical distress herself, under treatment for cancer. Many felt he would not come back to Pakistan to serve the sentence handed out in absentia by the National Accountability Bureau (NAB), given that he struck a deal and fled to Saudi Arabia under Musharraf's martial law.

But politically that might have been the end of Nawaz. Interestingly it was the chief justice who dismissed Nawaz from office and set the ball rolling for the NAB prison indictment.

So Siddiqui's comments come as a welcome validation for the embattled politician. Nawaz has repeatedly asked 'why me?' in his rallies implying that there is selective accountability in play. Selective accountability, he says, driven by the army's desire to see Nawaz's power cut down to size. Nawaz has come out now and said not dismantling NAB was his single biggest mistake; a relic he says, of Musharraf's dictatorship.

But even though the army stands accused of singling out Nawaz for accountability in an attempt to break the PML-N's stronghold on the National Assembly, the corruption accusations against him came with the Panama Leaks affair in 2016; when it was disclosed that Nawaz's sons are running offshore companies and that he was allegedly a benefactor of unsourced income.

If the intelligence agencies wanted to single out Nawaz it seems to be more a fortuitous case of deus ex machina than design.

As reality stands, no prime minister has completed a constitutional tenure in office before, but that is little consolation to Nawaz on his third successive failure. This time he sounds different. This time there seems to be a burning desire to overcome his opponents, whether real or imagined. But the prison sentence for Nawaz has come too close to the elections to start a groundswell of protests without endangering the party's standings in the polls. So here he is, held on charges of owning properties in England beyond his economic means.

Nawaz has also been relentlessly criticised in some circles of being too friendly with Narendra Modi, even fielding questions of having business interests in India that inform his foreign policy motivations. Nawaz has dismissed it all as nonsense but some nonsense will inevitably stick.

The strong guard of PML-N that involved people who stood by Nawaz under the Musharraf imposed exile have now left his side. His brother is going ahead with contesting these elections even as Nawaz's daughter Maryam is calling party workers to protest against their incarceration. There have been 21 defections from PML-N to Pakistan Tehreek-e-Insaf (PTI). Eleven have decided to abandon the PML-N and contest the election as Independents. That's 32 out of 272 seats potentially overturned. Six hundred party workers were arrested when Nawaz arrived from London on 13 July. The party feels victimised.

Political intrigue is of course par for the course in election season. The amount of violence committed this month is also, sadly, par for the course. Before the 2008 elections, we lost Benazir Bhutto to a terrorist attack, todaym we are mourning 150 dead in Mastung, Balochistan. Ikramullah Gandapur of PTI was killed in a suicide blast on Sunday. The provincial election for his erstwhile constituency has thus been postponed.

The Law Enforcement Agencies and security personnel charged with safeguarding election day have a mammoth task on their hands. And the sheer amount of militants, hard line Islamists and propagators of sectarian violence contesting these elections are alarming for most commentators.

The Pakistani establishment seems to be mainstreaming otherwise fringe militant groups. In April 2017, the Tehreek-e-Taliban Pakistan (TTP) spokesperson Ehsanullah Ehsan gave a conditional surrender and appeared on television claiming that TTP chief Omar Khorasani had received both funding and medical aid from New Delhi.

Now cross-border tensions are flaring up again with prominent Islamist groups contesting the ballot. There is no better example of that then Hafiz Saeed's face appearing on election banners all over Punjab.

Cited as the mastermind of the 2008 Mumbai attacks, Saeed has spent the last decade under detention and restricted movement but with no concerted effort to validate the claims against him put up by India. Witnesses against him seem to mysteriously disappear on court hearings.

What will happen on Wednesday is anyone's guess. The chances of a clear majority like the PML-N's sweep of the 2013 elections are slim. Anti-incumbency vote should be strong given the inability of the government to tackle the electricity outages and fend off corruption allegations. PTI forming a coalition government with Imran Khan — and the former cricketer is no stranger to India — becoming the prime minister is a likely outcome given the events of last year. Khan is the biggest beneficiary of Nawaz's political demise as Punjab gears up for the elections.

If the PTI can win enough seats to sway parties wary of being affiliated with persona non grata Nawaz, a Central government for Khan is on the cards; a weak Central government that relies on patchwork politics to survive the current political climate. Which would come with the blessings of Pakistan's military; a military that Nawaz has continuously argued wants a weak Central government that cedes Islamabad's foreign policy to Rawalpindi. An army that is now attempting a 'soft coup'.

Firstpost is now on WhatsApp. For the latest analysis, commentary and news updates, sign up for our WhatsApp services. Just go to Firstpost.com/Whatsapp and hit the Subscribe button.