The Supreme Court has directed the accountability court to decide corruption cases against Mr. Sharif and his family within in six months. But there is skepticism that the courts will reach a decisive verdict against the Sharif family and speculation that even if Mr. Sharif cannot run again, his Pakistan Muslim League-Nawaz Party will continue to dominate Parliament.

On Sunday evening, Mr. Khan was to address a large political rally in Islamabad, hoping to kick-start a new round of rollicking opposition to the governing party.

When Mr. Khan started the P.T.I. 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 Mr. Khan find himself center stage 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 youths, disgruntled with the system and energized by Mr. Khan’s populist, anticorruption and anti-American message. The party also picked up vast support among the Pakistani expatriate community, and Mr. Khan’s supporters are dominant on social media.

Despite his huge urban base, Mr. Khan has found it hard to prevail over Mr. Sharif’s Pakistan Muslim League-Nawaz Party, especially in Punjab, the former prime minister’s power base, and two other provinces.

Mr. Sharif remains deeply entrenched through a vast network of political patronage. His party won the 2013 general elections with an overwhelming majority. Mr. Khan’s party currently holds just 33 of the 342 seats in the National Assembly.

But since the last elections, Mr. Khan has been at the forefront of political opposition to Mr. Sharif, portraying him as the face of the status quo and corrupt practices that have gnawed at the political system.