Conflict with the Establishment, Mr. Weinbaum said, is “almost inevitable.”

Mr. Khan’s erratic personality is a further complication. He is known for running a team of one, making impulsive decisions, contradicting himself and then using his enormous reserves of self-confidence and charisma to dig himself out.

Take his views on religion. He has said that he wants to reform the madrasa system in which countless young Pakistani boys have been brainwashed in Quranic schools to fight for extremist groups. At the same time, Mr. Khan has supported Pakistan’s blasphemy laws and teamed up with hard-line religious groups that a few years ago rioted in Islamabad, the capital.

His sprawling villa on Islamabad’s outskirts, where he spends much of his time, symbolizes his guarded nature. The enormous compound, occupying a craggy hilltop, is tucked behind high walls. At night, you can see thousands of lights from Islamabad twinkling in the distance far below. Even though he’s still officially only one of hundreds of members of Parliament, several dozen police officers this weekend blocked the roads leading to his house and stood in clumps at his gates as if he were already prime minister.

To Western governments, Mr. Khan’s idiosyncrasies may not even matter that much. Analysts say there are only two issues the West really cares about in Pakistan: militant groups and nuclear arms. Mr. Khan will not have much say in either. The military and intelligence establishment handles both.

The biggest issue that Mr. Khan will control is the economy. This is where he could shine as a leader or quickly be subsumed. Pakistan is facing a balance of payments crisis, its currency has rapidly devalued, its debt is soaring.