What Happens Next in Pakistan’s Politics?

Imran Khan’s stunning performance in Pakistan’s national election has upended most traditional political forecasts in a country where leaders who run afoul of the powerful military rarely find electoral success.

Supporters of Mr. Khan, the jailed former prime minister, are both electrified by the showing of candidates aligned with his party, who won the most seats in last week’s vote, and enraged by what they call blatant rigging and the possibility that other parties will ultimately lead the government.

Here’s what to know about the uncertainty now hanging over Pakistan’s political system.

Mr. Khan’s supporters are challenging the results of dozens of races in the country’s courts, and pressure is growing on Pakistan’s Election Commission to acknowledge the widely reported irregularities in the vote counting.

Backers of Mr. Khan say they will hold peaceful protests outside election commission offices in constituencies where they contend the rigging took place. Protests have already erupted in several parts of the country, especially in the restive southwestern Baluchistan Province.

As of midday Sunday, the Election Commission had not finalized the results from Thursday’s vote. Preliminary counts showed victories for 92 independents (primarily supporters of Mr. Khan, whose party was barred from running), with 77 seats going to the Pakistan Muslim League-Nawaz, the party of former Prime Minister Nawaz Sharif, and 54 going to the third major party, the Pakistan People’s Party, or P.P.P.

To form a majority government, a party must have at least 169 seats in the 336-seat National Assembly. The Pakistani Constitution mandates that the National Assembly, or lower house of Parliament, convene within 21 days of an election to elect its leadership and subsequently the prime minister.

With candidates associated with Mr. Khan’s party, Pakistan Tehreek-e-Insaf, or P.T.I., short of a majority in the preliminary count, intense jockeying is underway to form a government.

Mr. Sharif’s party, P.M.L.N., is exploring an option to take control through a coalition with the P.P.P. and a smaller party, the Muttahida Qaumi Movement, which secured 17 seats. In another possible path to a P.M.L.N. government, Mr. Sharif is seeking to attract enough independent candidates so his conservative party would not need to align with the P.P.P., which leans left.

Although Mr. Sharif, a three-time prime minister, is heading his party’s negotiations, it is not certain who would lead any coalition opposing the populist Mr. Khan, who was prohibited from running in the election.

Mr. Sharif’s brother, Shehbaz Sharif, is a probable candidate for prime minister, having led a similar coalition after Mr. Khan’s ouster in April 2022. Shehbaz Sharif is seen as more deferential to the military than is Nawaz, who clashed with the generals during his time in office. Nawaz Sharif won a seat in Thursday’s vote, but the result has been challenged by Khan backers over rigging allegations.

Mr. Khan’s supporters might also seek to form a coalition government, though they face potential opposition from the military, which is widely believed to favor a P.M.L.N.-P.P.P. coalition. With Mr. Khan’s party banned, his backers who won seats would have to join another party that has extended support.

And his supporters are certain to form a government in the provincial assembly of Khyber Pakhtunkwa, where he is immensely popular and won an absolute majority.

The popular wave of discontent with the military’s meddling in politics is bound to put pressure on the country’s army chief, Gen. Syed Asim Munir.

General Munir must now decide whether to have some sort of reconciliation with Mr. Khan or barrel ahead and force a coalition of anti-Khan politicians, one that many analysts believe would be weak and unsustainable. In a public statement on Saturday, General Munir called for unity and healing, a sign some read as a willingness to engage with Mr. Khan.

Whichever path the general chooses, said Farwa Aamer, director of South Asia initiatives at the Asia Society Policy Institute, “the influential military could potentially lose public support.”

Continuing to keep Mr. Khan locked up will be a tough task for the military establishment. With his political victories, pressure will grow to let him out on bail, especially for the cases in which courts rushed to convict him in the days before the election.

On Saturday, Mr. Khan was granted bail in one of the many cases against him, this one involving violence by supporters who ransacked military installations in May. But he still faces decades in prison for his other convictions.

Some analysts pointed to similarities between today and 1988, when Benazir Bhutto won the election despite the opposition of the army and the intelligence service.

The generals grudgingly handed Ms. Bhutto the government under American pressure but did not allow her complete power, giving her no say in the country’s foreign policy or its nuclear weapons policy.

Ultimately, she did not complete her term, with her government ousted in 1990 over corruption and mismanagement charges.