The stunning election success of a party whose leader is in jail has set off a political crisis in Pakistan, a nuclear-armed nation of 240 million people.
The stakes are high: Pakistanis face soaring inflation and costs of living, frequent blackouts, resurgent terrorist attacks and tense relations with their neighbors.
Here are the critical figures competing for power.
Imran Khan: The jailed leader
Imran Khan, a former prime minister and cricket star, has been sentenced to 34 years in prison on charges that include leaking state secrets and unlawful marriage. He is barred from holding office, and his supporters call the charges, which he denies, an effort by the military to silence its leading critic.
Mr. Khan, 71, was ousted as prime minister in 2022 but staged a comeback, rallying young people with populist rhetoric and criticism of the dynastic families and military establishment that have dominated Pakistan for decades. In the election last week, candidates aligned with Mr. Khan won more seats in Parliament than any other group — but still fell short of forming a majority on their own.
Mr. Khan faces a legal labyrinth as he seeks to leave prison. Many experts believe his party is unlikely to assemble a governing coalition, given the military’s preference for its rivals and his tense relationships with the two other major parties.
But his party’s ability to organize support online has helped Mr. Khan persevere as a powerful influence. His party is challenging election results on the basis of widely reported irregularities in vote counting, and an A.I.-generated version of Mr. Khan declared victory on Saturday.
Nawaz Sharif: The other former prime minister
Mr. Khan’s main rival was another former prime minister, Nawaz Sharif. Both men were aligned with military generals when they took office and then fell out with them.
Analysts say military pressure contributed to Mr. Sharif’s trouble holding onto power: Despite being Pakistan’s longest-serving prime minister, serving three terms, he never finished one in office. (Pakistan has never had a prime minister finish a full term in office.)
He stepped down most recently in 2017, after he and his family were ensnared in corruption allegations that the Supreme Court ruled disqualified him from office.
Mr. Sharif, 74, spent years in self-imposed exile in London before returning to Pakistan last year after reaching a détente with the military, which sensed he could rival Mr. Khan’s popular support, analysts say. During his last term, he presided over a period of relative economic stability but ultimately fell out with the military over foreign policy and its role in politics.
His party won the second-most seats in Parliament, according to preliminary counts: 77 candidates, compared with the 92 aligned with Mr. Khan.
But it is not clear that Mr. Sharif would serve again as prime minister. Before the election, he suggested he only wanted the role if his party won a simple majority. In recent years, he has also become increasingly concerned about his legacy, and leading a weak government, after elections marred in allegations of rigging, could imperil it, analysts say.
Shehbaz Sharif: The former prime minister’s brother
Shehbaz Sharif, the 72-year-old brother of the former prime minister, is considered the military’s preferred choice for prime minister. He led a coalition government after Mr. Khan’s ouster, and is seen as more deferential to the military than his brother.
He became the standard-bearer of their party, the P.M.L.N., and is known for his administrative skills and his oversight of large infrastructure projects. He, too, has been dogged by accusations of graft and malfeasance that were the focus of several corruption investigations.
He has denied the allegations, but has also faced criticism over his leadership in Punjab, the country’s most populous province and the home of the Sharif dynasty. While chief minister there, he was accused of doing too little to curb extremist sectarian groups and ordering extrajudicial killings. He was acquitted of those charges in 2008.
The coalition government he presided over as prime minister was also widely unpopular and seen as unable to address the economic crisis. And he does not have the popular appeal of his elder brother, who maintains a loyal base of support in parts of Punjab.
Bilawal Bhutto Zardari: A dynastic scion
The third-most seats in Parliament went to the Pakistan People’s Party, potentially making it a key player in any coalition.
The party is led by Bilawal Bhutto Zardari, the son of Benazir Bhutto, who in 1988 became the first woman to be democratically elected to lead a Muslim country. Ms. Bhutto was elected twice, twice expelled from office — under pressure from the military on charges of corruption — and assassinated in 2007 as she sought a third term in office.
Her son, 35, has sought to turn around the party’s declining fortunes, partly by appealing to people outside the party’s base in southern Pakistan. The party could form part of a Sharif-led coalition government — and on Sunday, leaders from both parties met to discuss that possibility.
Hanging over all these politicians is the military, which has for decades acted as Pakistan’s ultimate authority, ushering in civilian leaders, staging coups and guiding political decisions. Last week’s election was a stunning upset for the military, which had relied on its long effective playbook for crushing political dissent.
Gen. Syed Asim Munir, the military’s chief, is widely considered a personal rival of Mr. Khan. But since the election, General Munir has faced pressure to strike a deal with the imprisoned leader that might involve his eventual release on bail.
If they do not reach a deal, Mr. Khan could tell his party’s winning candidates to resign from Parliament in protest. That could create further political chaos for the country, undermining the legitimacy of the incoming government. Those leaders will also have to contend with rising anger that many Pakistanis feel toward the military as it cracks down on protests, and as economic problems have multiplied on its watch.