His political opponents have no shortage of derisory nicknames for him. The “ladla” or spoiled child some have dubbed him, while others have given him the moniker “Taliban Khan”.

This weekend, though, no amount of name-calling has stopped Imran Khan from becoming the prime minister-elect of Pakistan.

The election win for the 65-year-old populist, who campaigned as a “change” candidate bent on building a “new Pakistan,” has been widely trumpeted in some quarters as historic for breaking the Bhutto and Sharif family dynasties and two-party duopoly that has dominated national politics for decades.

But as the country’s election commission prepares to confirm the former Oxford-educated cricketing star’s election victory, Pakistan continues to reel from polls marred by widespread allegations of vote-rigging and interference by its all powerful military.

Yesterday there were signs of the potential unrest to come as a group of rival parties to Khan’s Pakistan Tehreek-i-Insaf (PTI) party announced that they rejected the results of the poll and would launch protests to demand fresh elections.

At a multi-party conference called to devise a joint strategy over alleged manipulation in the election, there were demands for a “transparent” re-election and accusations that last Wednesday’s polls were “massively rigged.”

Held in the Pakistan capital Islamabad, the conference was attended by Shahbaz Sharif, president of the former governing Pakistan Muslim League-Nawaz (PML-N) that earlier had appeared to have conceded the election and said it was ready to go into opposition. But confusion remains as to where Sharif and his party will ultimately stand in response to the election result.

Sitting alongside Sharif at a news conference following the meeting, Maulana Fazalur Rehman, leader of the MMA party and spokesman for the group of rival parties, was much more forthright, however. “We will run a movement for holding of elections again. There will be protests,” Rehman insisted.

This announcement by key opposition leaders is an ominous sign of the challenges Imran Khan as prime minister faces in the weeks, months and if his political survival allows, the years ahead.

No prime minister in Pakistan’s history has ever completed a full five-year term in office, and Khan’s victory marks only the second time there has been a civilian-to-civilian handover of power after a full term. The first was in 2013.

In the intervening years Pakistan’s army and shadowy influential security service, the Inter-Services Intelligence Directorate (ISI), have often taken the running of the country into their own hands.

Given the latest acrimony and uncertainty, what then are the actual challenges facing Pakistan’s fifth prime minister in seven years and what might it mean for the future of the country?

The logical place to begin answering such questions is with the conduct of the election itself. For months running up to last week’s poll, accusations have grown that the military and ISI were the hidden power behind Khan’s leadership bid.

Election-watchers point to the fact that the army, which dismisses allegations of meddling, deployed 371,000 soldiers at polling stations across the country, nearly five times the number as in the last election in 2013.

While in part this was doubtless a safeguard against violent terrorist attacks, some of which succeeded in killing voters, many believe the deployment had more sinister and intimidatory motives.

While the military has denied it has backed any particular candidate in the vote, observers claim that the security forces have helped promote candidates running for Khan’s PTI party, and moved to silence its opposition.

General Asif Ghafoor, the Pakistan army’s spokesperson, was criticised after tweeting: “You honour who You will and You humble who You will”, a verse from the Koran that was taken in some quarters as confirmation of the military’s support for Khan.

Certainly in this wider regard the army and ISI have historical form with some observers pointing to the military’s guiding hand being visible in the partisan judiciary that corruption convictions effectively sidelined ex-prime minister Nawaz Sharif who now languishes in jail with his daughter.

In what some critics described as a “creeping coup,” there were reports too of ISI’s role in compelling a host of candidates to switch parties, and journalists and media outlets being intimidated and silenced. One of the media victims of the crackdown was said to be private Pakistani TV news channel Geo Television that was taken off air as early as April.

After months of financial losses, Geo reportedly agreed to the security establishment’s demands to self-censor and abide by strict guidelines.

After this surrender, the media industry as a whole tended to toe the political line that had been laid down. Even Pakistan’s oldest newspaper, Dawn, has been disrupted since May.

“The so-called soft creeping coup which was conceived by the deep state and midwifed by the judiciary during the last few years has not only culminated in full fledged authoritarian control but has also acquired some hard dimensions,” warned Afrasiab Khattak, a former Pakistan senator and political analyst in Pakistan daily newspaper The Nation shortly before the vote.

Others shared his concern including the Human Rights Commission of Pakistan (HRCP) which warned of “blatant, aggressive, and unabashed attempts to manipulate the outcome of the elections”.

According to independent international election observers, many were unable to gain visas until days before the vote. Typically, such monitoring officials are usually in a country for weeks ahead of any polling day.

“We have never had a situation like this in any of our 150-plus missions,” Dmitra Ioannou, the deputy chief observer for the EU Election Observation Mission, was quoted as saying. While in its initial findings the EU concluded that the elections were relatively transparent and saw no open evidence of rigging, it did raise the alarm on unfair pre-election practices.

“Although there were several legal provisions aimed at ensuring a level playing field, we have concluded that there was a lack of equality and opportunity,” was how Michael Gahler, chief observer of the EU Election Observation Mission, summed up the findings.

The allegations over election malpractice will continue to plague Khan, but even bigger challenges lie in store for him and Pakistan in the future.

The new leader will rule over a country in economic crisis, one where debts are rising and foreign reserves shrinking. Most likely Khan’s government too will have little choice but to look at another round of traumatic bailout negotiations with the International Monetary Fund (IMF).

Though Khan fought an election campaign with consistent promises to combat the widespread corruption that has long held Pakistan in its grip, here too he will have his work cut out.

“Corruption, persistent terrorist violence, and decades of bad government have saddled the country with an almost bottomless list of structural problems, such as illiteracy, sectarianism, and public-health crises,” observed Steve Coll, the veteran Pakistan-watcher and author in last week’s New Yorker magazine.

“It’s no wonder that the Army does not wish to run Pakistan directly these days. Better to let ambitious civilian politicians like Khan take on the intractable problems, while the generals take care of themselves offstage,” Coll continued, again acknowledging the military’s omnipresence in Pakistan’s political affairs.

Nowhere will Khan likely encounter that presence more than in the foreign policy sphere. For decades, Pakistan’s regional foreign policies concerning India and Afghanistan have been hands-off territory for elected civilian leaders.

Countless attempts by elected governments to craft independent regional policies or initiate dialogue with neighbours, notably India, have entailed heavy penalties at the hands of the army.

Given Khan’s positioning to date on a number of pressing regional and international issues, he might just find himself at loggerheads with the generals.

Even during his victory speech last Thursday Khan seemed keen to give notice to the military that it would be business as usual and stressed continuity in foreign policy though this might prove trickier to pull off than he admits.

For years now and certainly during his election campaign Khan, despite his past as a Western-educated globetrotter, has consistently challenged US involvement in Pakistan and neighbouring Afghanistan. In doing so he has constantly thrown down the gauntlet to other Pakistani leaders for allowing the country to be used as a “ hired gun” by Washington.

As political career moves and election sloganeering goes this has served him well with his grass-roots supporters. As one of the most virulent opponents of the US “war on terror”, Khan has opposed Washington’s controversial drone campaign in Pakistani regions bordering Afghanistan, galvanising local support in the frontier areas and communities.

Time and again he held the former Pakistani president and army chief Pervez Musharraf responsible for allowing Pakistan to become a staging post for the US war against the Taliban across the border.

But now, as incoming prime minister, the time might be short-lived for the continuation of such political positioning.

“Once the work of statecraft begins, the rhetoric will self-calibrate”, noted the Pakistan-based journalist Mehreen Zahra-Malik in the US current affairs magazine Foreign Policy last week.

“Indeed, power has a moderating influence on most leaders, likely including Khan, not least because the Pakistani military, the main beneficiary of security aid and the real decision-maker when it comes to all things foreign policy, is keen to salvage its relationship with the US,” Zahra-Malik continued.

Pakistan’s election has come at a time when its foreign relations are the most damaged they have been in decades. Currently the US and Afghanistan accuse Islamabad of allowing Taliban militants and its cohorts, like the Haqqani group to operate out of sanctuaries in Pakistan. Also within the region a standoff with archrival India over the disputed region of Kashmir grows ever more tense.

Just last month Pakistan was also placed back on a terror financing watchlist. Pakistani officials attending a meeting in Paris had tried in vain to persuade the Financial Action Task Force (FATF) to keep Pakistan off a list of nations with inadequate controls to prevent terror financing and money laundering.

Pakistan was included on the watchlist for three years until 2015, and FATF has now told the Islamabad government what needs to be done in order for it to be taken off the list again. This blacklisting is yet another obstacle Khan faces and will not be easy to overcome with some in the West. For years now Khan has kept up a consistently anti-Americanism rhetoric in his political campaigning.

Should the Pakistan military have been supporting his election campaign to the extent many believe then he will doubtless now have to tone down his criticism of Washington, leaving him kowtowing to the Pakistan army in foreign-policy matters.

While Khan, his PTI party and the Pakistan military all share a common call for dialogue with the Afghan Taliban, there are considerable differences in their response to the Pakistani Taliban.

According to Farzan Shaikh, an Associate Fellow of the Asia-Pacific Programme at Chatham House, Khan’s PTI donated more than $3 million while in power in Pakistan’s Khyber-Pakhtunkhwa province to the notorious Haqqani religious seminary, headed by a cleric known as the “father of the Taliban”.

This does not sit well with the Pakistan military which has waged a fierce war against the Haqqani network, which has also been a target of US counterterrorism operations along the Pakistan-Afghanistan frontier.

For Khan as prime minister-elect, these are very early days, but few doubt that in terms of deciding the direction of Pakistan regional policies such a process will continue to rest with the military and not with the next prime minister.

As Steve Coll wryly summed it up in the New Yorker: “The office of Prime Minister of Pakistan will remain the country’s second most powerful position, after the Chief of Army Staff, currently held by General Qamar Javed Bajwa.”

Winning last week’s election was the easy part for Imran Khan. It may be an unfortunate cricketing pun, but now the real “test” begins.