Imran Khan was dismissed Sunday as Pakistan's prime minister after losing a no-confidence vote, paving the way for an unlikely opposition alliance that faces the same issues that bedevilled the cricket star-turned-politician.

A new premier will be chosen Monday, with centrist Pakistan Muslim League-N (PML-N) chief Shehbaz Sharif already anointed to lead the nuclear-armed nation of 220 million people.

His first task will be to form a cabinet that will also draw heavily from the centre-left Pakistan Peoples Party (PPP), as well as find space for the smaller conservative Jamiatul Ulema-e-Islam-F (JUI-F) group.

Pakistan newspapers peppered their coverage of the political crisis with cricket metaphors
Pakistan newspapers peppered their coverage of the political crisis with cricket metaphors AFP / Aamir QURESHI

The PPP and PML-N are dynastic parties that have dominated Pakistani politics for decades -- usually as bitter rivals -- and their relations are sure to fray in the lead-up to the next election, which must be held by October 2023.

Shehbaz Sharif is the brother of disgraced three-time prime minister Nawaz Sharif, while PPP leader Bilawal Bhutto Zardari is the son of former president Asif Ali Zardari and assassinated ex-premier Benazir Bhutto.

Chart on the composition of the Pakistan parliament.
Chart on the composition of the Pakistan parliament. AFP / John SAEKI

Khan's exit was met with a mixture of glee and sympathy.

"Back to the pavilion," screamed the influential Express Tribune newspaper, using a cricket metaphor headline writers have found difficult to resist during Khan's tenure.

Pakistan Peoples' Party supporters celebrate in Karachi after the supreme court decision
Pakistan Peoples' Party supporters celebrate in Karachi after the supreme court decision AFP / Asif HASSAN

No prime minister has ever served a full term in Pakistan, but Khan is the first to lose office via a vote of no-confidence.

"Sad day for Pakistan... a good man sent home," his former information minister Fawad Chaudhry said on Twitter.

There had been high hopes for Khan when he was elected in 2018 on a promise of sweeping away decades of entrenched corruption and cronyism, but he struggled to maintain support with soaring inflation, a feeble rupee and crippling debt.

Militancy is also on the rise, with Pakistan's Taliban emboldened by the return to power last year of the hardline Islamist group in neighbouring Afghanistan.

Socio-economic profile of Pakistan.
Socio-economic profile of Pakistan. AFP / Janis LATVELS

Khan had vowed to fight "until the last ball", and he certainly took his exit to the wire Sunday.

He tried everything to stay in power after losing his majority in parliament -- including dissolving the assembly and calling a fresh election.

But the Supreme Court deemed all his actions illegal and ordered them to reconvene and vote.

Pakistan Prime Minister Imran Khan, addressing the nation on April 8, 2022, appeared set to lose a no-confidence vote following the defection of a coalition partner and several of his own party members
Pakistan Prime Minister Imran Khan, addressing the nation on April 8, 2022, appeared set to lose a no-confidence vote following the defection of a coalition partner and several of his own party members AFP / Aamir QURESHI

Still, there was drama right until the midnight deadline ordered by the court, with the speaker of the assembly -- a Khan loyalist -- resigning at the last minute.

The session restarted after midnight with a replacement, and the vote was finally held.

Khan's Tehreek-e-Insaf (PTI) lawmakers stormed out, but the no-confidence motion passed with 174 votes in the 342-seat assembly.

New Pakistan governments frequently have a reckoning with those they replace, but Sharif said there would be no vendettas.

"We will put a balm on the wounds of this nation," he said immediately after the result was announced.

Khan insists he has been the victim of a "regime change" conspiracy involving Washington, and he is certain to tap into anti-US sentiment from the opposition benches.

"Khan's politics don't stop here, his support base is intact," said Zahid Hussain, a political analyst and author.

"His narrative of last few months, that he has been removed through a foreign conspiracy, has earned him some support."

His party has called for mass protests to start after the Ramadan fast is broken Sunday evening, while Khan has vowed in his first tweet since being ousted that he would not give up.

"Pakistan became an independent state in 1947; but the freedom struggle begins again today against a foreign conspiracy of regime change," he said.

Political analyst Talat Masood said Khan appears to want to "create problems" for the next government.

"From what he has been saying, he seems to want to... pursue a kind of a policy of trying to sort of rebel rather (than) make things better for the country and society," Masood, a former general, told AFP.

Former information minister Chaudhry, meanwhile, said the PTI leadership had recommended its representatives resign en masse from the national assembly.

But the party would also file papers nominating ex-foreign minister Shah Mahmood Qureshi for prime minister against Sharif, he said.

Publicly, the military appears to be keeping out of the current fray, but there have been four coups since independence in 1947, and Pakistan has spent more than three decades under army rule.