ISLAMABAD (NYTIMES) - In 1992, when Pakistan won its only Cricket World Cup, Prime Minister Nawaz Sharif was asked by a television host if the team captain, Imran Khan, a national heartthrob, would be right for his party if Khan went into politics.
"I offered him a long time ago, but he declined. I don't know why," Sharif said, patting Khan's shoulder as everyone who had gathered around burst into laughter.
Khan, a charismatic athlete well known then for his playboy image and affairs with British socialites, did go into politics a few years later through his own party, Pakistan Tehreek-e-Insaf, or PTI.
On Friday, the country's Supreme Court ruled that corruption accusations against Sharif, 67, a veteran politician who thrice served as prime minister and has defined Pakistan's politics for decades, were sufficient to remove him from office.
For Khan, 64, the moment was sweet. He had been the main petitioner before the court and fomented widespread street protests against Sharif, emerging as the strongest challenger to the former prime minister and his political legacy.
But Khan's path to victory in the next general election, set for mid-2018, is far from assured, according to analysts, including Moeed Yusuf, associate vice president of the Asia Centre at the United States Institute of Peace, whose research and work centres on Pakistan.
"In some ways, this is a clear victory; there is no question about that," Yusuf, who is currently visiting Pakistan, said in an interview. "Sans Panama Papers scandal, PML-N, the ruling party, was sitting pretty for the next elections." The scandal he referred to comprised disclosures in last year's leaked Panama Papers that Sharif and his children hid much of their enormous wealth in offshore bank accounts and related investments.
Still, Yusuf said, he did not believe Khan was "closer to a victory in the elections" than he had been before the ouster. "Whether he gets closer or not depends on his own behaviour and whether Nawaz overplays his hand and what Accountability Court does." The Supreme Court has directed the Accountability Courts to decide corruption cases against Sharif and his family within in six months. But there is scepticism that the courts will reach a decisive verdict against the Sharif family and speculation that even if Sharif cannot run again, his Pakistan Muslim League-Nawaz Party will continue to dominate Parliament.
On Sunday evening, Khan was to address a large political rally in Islamabad, in hopes of kick-starting a new round of rollicking opposition to the governing party.
When Khan started the PTI party in 1996, he was considered a political nobody and squirmed on the sidelines for decades. His party had just one seat in Parliament after the 2002 elections and boycotted the 2008 elections.
Not until 2011 did Khan find himself centrestage as he captured the public's imagination and began drawing hundreds of thousands of Pakistanis to his political rallies. Most people in the audiences were educated, urban youth, disgruntled with the system and energised by Khan's populist, anti-corruption and anti-American message. The party also picked up vast support among the Pakistani expatriate community, and Khan's supporters are dominant on social media.
Despite his huge urban base, Khan has found it hard to prevail over Sharif's Pakistan Muslim League-Nawaz Party, especially in Punjab, the former prime minister's power base, and two other provinces.
Sharif remains deeply entrenched through a vast network of political patronage. His party won the 2013 general elections with an overwhelming majority. Khan's party currently holds just 33 of the 342 seats in National Assembly.
But since the last elections, Khan has been at the forefront of political opposition to Sharif, portraying him as the face of status quo and corrupt practices that have gnawed at the political system.
In many ways, Khan did not let Sharif settle into office. His popular agitation kept the prime minister perpetually unsettled and fighting to gain traction despite his party's success at the polls. The situation was made more difficult by Sharif's constant friction with the powerful military, elements of which favour Khan.
Soon after the elections, Khan accused Sharif of vote rigging. In 2014 he led thousands of protesters in a siege of Islamabad, the capital, for months.
Shortly after the Panama Papers revelations, Khan again tried to lay siege to Islamabad in November 2016. He forced the Supreme Court to take up the corruption case against Sharif, which culminated in the prime minister's ouster on Friday.
Some analysts say Sharif's party can survive if the transition to his successor is smooth and energy and infrastructure projects are completed well before the next elections.
"If Nawaz manages a smooth transition to the next prime minister, I think he still has a clear edge going into the next elections," Yusuf said.
Other analysts say the country's powerful generals might be reluctant to see Khan in power. Critics dismiss him as soft on militancy; some even ridicule him with the nickname "Taliban Khan".
Khan has no experience with governing and has shown an aptitude more for street agitation than working with Parliament to bring about change. Many diplomats expressed shock at what they see as his disregard for the parliamentary process.
But enamored supporters say Khan is not corrupt like traditional politicians and point to his philanthropic work as a proof that he will do more good for the country.
Husain Haqqani, the director of Hudson Institute and a former Pakistani ambassador in Washington, described Khan as an "instrument" to force Sharif from power but not to succeed him.
"He is not the kind of man the establishment would like to be in charge," said Haqqani, a longtime observer of Pakistani politics. "He is mercurial and unpredictable. It took the generals two decades to cut Nawaz Sharif to size after they created a political career for him. They will not make the same mistake again, of helping someone they cannot control."
Haqqani said he expected the current Parliament to complete its term, which also ends in mid-2018.
"PML-N has a clear majority in the Parliament and Punjab," he said. "There is no legal basis for an early election. PML-N will be allowed to limp to the end of its tenure."
Khan too faces cases against him in the Supreme Court and the election commission, stemming from accusations of hiding assets and of foreign funding of his political party. There has been speculation that the courts could bar him from Parliament over these accusations, speculation that Khan laughs off.
"How can I be disqualified?" he said in an interview. "I was never a public office holder. The whole world knew I was playing cricket. I have given my whole money trail to the Supreme Court. It is just blackmail."
Yusuf, of United States Institute of Peace, said he worried that "this could be Imran's Trump moment".
"What I mean is that you are a leader of a party or campaign and you have basically defied all odds to secure a major political victory," he said, "and now you could be in a situation where you feel you do not have to take counsel from the people who are going to advise patience, advise taking the long course, rather than declaring victory and overplaying your hand."