Here's a little fairy tale from Pakistan. Fourteen years ago a wise man ruled the country. He enjoyed the support of his people. But some of his treacherous generals thought he wasn't that smart. One night he was held at gunpoint, handcuffed, put in a dark dungeon, sentenced to life imprisonment. But then a little miracle happened. He, along with his family and servants, was put on a royal plane and exiled to Saudi Arabia, that fancy retirement home for the world's unwanted Muslim leaders.
Two days ago that same man stood on a balcony in Lahore, thanked Allah and said: Nawaz Sharif forgives them all.
But wait, if it were a real fairy tale Imran Khan would have won the election instead, right? Can't Pakistani voters tell the difference between a world-famous, world cup-winning, charismatic leader and a mere politician who refers to himself in the third person?
Why didn't Imran Khan win?
Well he has, sort of. But not in the way he would have liked.
Visiting foreign journalists have profiled Khan more than they have profiled any living being in this part of the world. If all the world's magazine editors were allowed to vote for Khan he would be the prime minister of half the English-speaking world.
If Khan had contested in west London he would have won hands down. But since this is Pakistan, he has won in Peshawar and two other cities. His party is set to form a government in Khyber Pakhtunkhwa, that north-western frontier province of Pakistan – which, Khan's profile writers never fail to remind us, is the province that borders Afghanistan and the tribal areas that the world is so scared of. Or, as some others never fail to remind the world: the land of the fierce Pathans.
It's true that Khan ran a fierce, bloody-minded campaign, drawing huge crowds. When his campaign culminated in a televised tumble from a stage during a public rally, the whole nation held its breath. Khan not only galvanised Pakistan's parasitical upper classes, he also found support among the country's young men and women of all ages; basically the kinds of people who use the words politics and politician as common insults.
He inspired drawing room revolutionaries to go out and stand in the blistering heat for hours on end to vote for him. For a few months he made politics hip in Pakistan. Partly, he was relying on votes from Pakistan's posh locales. He probably forgot that there was a slight problem there: not enough posh locales in Pakistan.
There were kids who flew in from Chicago, from Birmingham, to vote for him. Again, there are not enough Pakistani youngsters living and studying in Chicago and Birmingham. He appealed to the educated urban middle classes, but Pakistan's main problem is that there aren't enough educated urban middle-class citizens in the country.
And the masses, it appears, were not really clamouring for a revolution but for electricity.
From the gossip columns of British tabloids to massive political rallies across Pakistan, Khan has been on a meaningful journey. In his campaign speeches his blatantly Blairite message of New Pakistan did appeal to people, but he really tested his supporters' attention span when he started to lecture them about how the Scandinavian welfare state model is borrowed from the early days of the Islamic empire in Arabia.
Amateur historians have never fared well in Pakistani politics. Or anywhere else. Khan promised to turn Pakistan into Sweden, Norway or any one of those countries where everyone is blond and pays taxes.
His opponents promised Dubai –where everyone is either a bonded labourer or a property speculator and no one pays taxes – and won.
It's a bit of a fairy tale that Khan, whose message was directed at educated urban voters, has found supporters in the north-western frontier province that profile writers must remind us is largely tribal and the front line of the world's war on terror. Khan has led a popular campaign against drone attacks. He has promised that he will shoot down drones, look Americans in the eye, sit down with the Taliban over a cup of gahwa (Arabic coffee) and sort out this mess.
So we finally have someone who feels at home in Mayfair as well as Peshawar. He finally has the chance to rule Peshawar. He has a slight problem: he speaks no Pashto, the language of the Pathans. But his first fight will be against American drones hovering in the sky. And drones speak no Pashto either. If Khan can win this match, he can challenge Sharif in the next elections.
Is this Nawaz Sharif man for real?Hasn't he been tried before? Twice?
It seems voters in Punjab, Pakistan's second-largest province, just can't get enough of this guy. At every campaign stop, Sharif reminded his supporters of two of his biggest achievements: I built the motorway, I built the bomb. He did build Pakistan's first motorway. And despite several phone calls from the then American president, Bill Clinton, and other world leaders and offers of million of dollars in aid, Sharif did go ahead and order six nuclear explosions in response to India's five. And then he thought that now that both countries have the bomb he could go ahead and be friends with India.
While he was making history hosting the Indian prime minister in the historic city of Lahore, his generals were busy elsewhere, repeating history on the mountains of Kargil. In a misadventure typical of Pakistani generals, they occupied the abandoned posts and then pretended that these were mujahideen fighting India and not regular Pakistan army soldiers.
When India reacted with overwhelming force and a diplomatic offensive, Sharif pleaded ignorance and rushed off to Washington to bail out the army and his own government. Clinton praised his diplomatic skills and the crisis was resolved briefly. When, months later, he tried to fire his handpicked army chief, General Pervez Musharraf, the architect of the Kargil fiasco, a bunch of army officers put their guns to Sharif's head. Handcuffed, jailed and sentenced to life imprisonment, in the end Sharif was saved by his powerful friends in Saudi Arabia and a royal jet flew him, his family and his servants to the palace.
An exile in Saudi Arabia for Muslim rulers is generally considered a permanent retirement home where you get closer to Allah and atone for past sins. Sharif must be the only politician in exile in Saudi Arabia who not only managed to survive this holy exile, but in the process got a hair transplant and managed to hold on to his political base in Pakistan.
Many of his political opponents say that if Sharif wasn't from the dominant province Punjab, where most of the army elite comes from, if he didn't represent the trading and business classes of Punjab, he would still be begging forgiveness for his sins in Saudi. But he returned just before the last elections and has been behaving like a statesman. A very rich statesman.
It is yet to be proven whether eight years of exile in Saudi Arabia can make anyone wiser but it has never made anybody poorer. Sharif was rich before he got into politics, then he became fabulously rich. Even in exile the Saudis gave him a palace and, on his return, a fleet of bulletproof limousines. His campaign proved that poor people don't really vote for somebody who understands poverty, or wants to do anything about it.
People have voted him in because he talks money, talks about spending money and talks about opening a bank on every village street – and who doesn't like that? He has promised motorway connections and airports to towns so small that they still don't have a proper bus station. Poor people, who couldn't afford a bicycle at the time of the elections, like to be promised an airport. You never know when you might need it.
In his five years' rule in Punjab, Sharif's party has had one policy about the Pakistani Taliban, who have been wreaking havoc in parts of Pakistan: please go and do your business elsewhere. And they have generally obliged. But now that he is set to rule all of Pakistan, what's he going to tell them?
Have we defeated the Taliban or sent them a friend request?
When Pakistan decided to throw itself an election party, the first ones to arrive were the Taliban.
They weren't really interested in the party because they keep reminding us that elections are un-Islamic and a major sin on a par with educating girls. But they were interested in watching what party games were played and who got to play them.
They decided that the three political parties that had ruled Pakistan for the past five years and taken a clear stand against the Taliban would be targeted. And the Taliban started their own campaign, targeting candidates and their supporters with bomb attacks and drive-by shootings.
In one case, a candidate in Karachi was shot as he came out of a mosque. Along with his six-year-old son.
The election campaign across Pakistan looked like this: some parties held huge rallies, in a carnival-type atmosphere with live tigers and massive music systems. Other candidates sneaked from one little corner meeting to another trying to remind people of their heroic stand against the Taliban. Many of the candidates were never seen in public. Journalists refused to visit them because they were sitting targets. Bilawal Bhutto Zardari, the public face of the ruling People's party, could only deliver a couple of video messages from Dubai.
The other parties, the ones who were allowed to campaign freely, were grateful in their silence. When we look at the election results we must not forget that while the Pakistani Taliban didn't contest the elections as a political party, they did see themselves as kingmakers.
In Pakistan's liberal media the Taliban are often described as brutes with an endless bloodlust. But by making allies and choosing partners they have demonstrated that they are at least as canny as the average campaigning politician.
But in the end the Taliban failed to deliver the kind of devastation they had promised. They managed to kill about 130 people in eight weeks. In the past they have achieved that kind of number in a single day. Also, 60% of Pakistanis who came out to vote seem to be politely disagreeing with the Taliban by saying that there is nothing un-Islamic about standing in a queue and stamping a ballot paper.
The Taliban's real success is that they bet on the winners. They promised not to attack Khan and Sharif's parties. And these parties will be in power. But the Taliban have never contested an election before. And they are soon to find out that politicians never keep the promises they make during the heat of the campaign. – © Guardian News & Media Ltd 2013
Mohammed Hanif is BBC Urdu's special correspondent based in Karachi. He is the author of A Case of Exploding Mangoes and Our Lady of Alice Bhatti