Thousands of people remain on the streets of Islamabad while a delegation of opposition parties tries to broker a settlement with Mr. Khan and Mr. Qadri. (The 11 other political parties in Parliament, including the main opposition Pakistan Peoples Party led by former president Asif Ali Zardari, have rallied around Mr. Sharif.) The idea would be to leave Mr. Sharif in office, at least for now, but address the protesters’ demands for reform.

Mr. Khan claims that last year’s election was rigged at Mr. Sharif’s behest and is demanding his ouster, electoral reforms and new polls. Mr. Khan is a sore loser. His party, Pakistan Tehreek-e-Insaaf, won 35 of 342 seats in Parliament and control of the government in Khyber-Pakhtunkhwa Province, which borders Afghanistan. But Khyber-Pakhtunkhwa, which is war-torn and poor, is an inadequate vehicle for Mr. Khan’s ambitions, and so Mr. Khan has set out to dethrone the prime minister. In the process, this brazen Taliban apologist has infused ignorance and arrogance into the national political conversation. Between asinine references to his sporting career and crass allusions to Mr. Sharif wetting his pants, Mr. Khan has advocated tax evasion, lawlessness and money laundering as forms of civil disobedience against the state.

Inconveniently for the prime minister, Mr. Khan hails from the same power base: the urban, densely populated, affluent swathe of North Punjab, which stretches from Lahore, the provincial capital, to Islamabad and accounts for well over a quarter of the seats in Parliament. North Punjab is the military’s recruiting ground and the historical beneficiary of its dominance. North Punjabis, roughly one-third of Pakistan’s entire population, are the country’s premier citizens. They dominate its political, military and bureaucratic elites, its unruly media, its civil society.

Over the years, Mr. Sharif has gone from military protégé to ardent democrat. This transformation is popular with Punjabis, which means he is now less vulnerable to being deposed by the military. On the other hand, it has created space for Mr. Khan to represent the region’s pro-military sentiment. Had protesters, or political leaders, from Pakistan’s smaller provinces displayed as much gall as Mr. Khan has, they would have been put back in their place with swift brutality. But just as the military cannot afford to carry out a direct coup against Mr. Sharif, Mr. Sharif must tolerate Mr. Khan and his supporters.

Mr. Qadri, the cleric, is an altogether more complex entity. His party boycotted the election last year, and now he is calling for a revolution to bring about genuine democracy. A fiery orator, Mr. Qadri spouts powerful rhetoric about social exclusion and disempowerment, and oversees a broad-based alliance of persecuted Shiite and anti-Taliban Sunni Muslims. His supporters — a pious and literate cross-section of society — makes up much of the crowd at the sit-in: It was the unprovoked June 17 attack by the Sharif-controlled police on Mr. Qadri’s headquarters in Lahore, which killed 14 people, that provided the impetus for the protests.