Mr. Khan, on the other hand, was someone the military chiefs believed he could work with. Analysts said he shared their belief that Pakistan would come less to the United States and talk more to the Taliban and other extremist groups.
In the run-up to the election, the military seemed to exert even more pressure on Mr. Khan. Human rights groups, academics and members of other political parties said security forces are threatening politicians in rival parties to join Mr. Khan's side. Some did.
That does not mean that Mr. Khan was not really popular. He was especially among young men who praised him as a sports hero. As national elections approached, a Khan wave began to sweep Pakistan. His face was everywhere ̵
There were still votes cast on Thursday, but Mr. Khan's party was far ahead of anyone else, even though it had still not achieved an absolute majority in parliament. After the results broadcast on state television, Mr. Khan's party had won 120 seats, Mr. Sharif's party had won 61, and a Bhutto party, one of Pakistan's most traditional political families, had reached 40 points.
It is widely expected that in the coming days, Mr. Khan will lead politicians of several smaller parties to join a coalition government, with him as prime minister. Depending on how many smaller parties he employs, his government could be strong or weak.
What will Mr. Khan be facing?
Domestically, the challenges will be overwhelming. Pakistan's electricity grid is falling apart, its infant mortality rate is among the most depressing in Asia, its currency is slipping, and its debt – especially to China – is rising. So many Pakistanis do not find jobs that every year lead countless young men to a desperate exodus to the Middle East to work as street cleaners, porters, anything.