The two traditional powerhouses of Pakistani politics and rivals to Pakistan's jailed former Prime Minister Imran Khan announced late on Tuesday that they planned to form a coalition, ending a deadlock which followed last week's parliamentary election, where no party secured a simple majority.
The Pakistan Muslim League-Nawaz (PML-N) of former three-time Prime Minister Sharif Nawaz said it was joining forces with the Pakistan People's Party (PPP), as well as other smaller parties.
Together, the parties would have enough seats to command a majority in parliament.
The PML-N controls 75 seats and the PPP 54. Candidates from Khan's Tehreek-e-Insaf (PTI) party mostly had to run as independents in the vote, but still make up the largest single group in parliament, with 93 lawmakers. Khan is ineligible to serve as prime minister while in jail.
There are 265 parliamentary seats in all.
Who would lead the coalition government?
A PML-N spokesman said former Prime Minister Shehbaz Sharif, Nawaz Sharif's younger brother, would be nominated to lead the new government as well.
The younger Sharif was prime minister after the PML-N and the PPP brought about a no-confidence vote which unseated Khan in 2022.
What the party leaders Sharif and Zardari said about the agreement
The PML-N's leader Sharif only returned to the country last October after four years of self-imposed exile.
"We have decided that we will form a government together to take Pakistan out of crisis," the co-chairman of the PPP, former President Asif Ali Zardari, told a news conference.
He did not elaborate on who would fill key positions in the next government.
"The parties present here are almost two-thirds of the house that has been elected," said PML-N leader Shehbaz Sharif. He added that his party was even willing to include Khan's Tehreek-e-Insaf (PTI) in the next government.
"Forget and forgive; forgive and forget — come let's join hands for the betterment of the country," he said. "Sacrifice self interests, set the issue of egos aside."
Khan had snubbed this possibility earlier in the day. Speaking during a court appearance at Adiala Jail outside the capital Islamabad, Khan said his party "will neither sit with the PML-N nor with the PPP."
'Back to square one,' analyst warns
Akbar Ahmed, an international relations professor and former Pakistan high commissioner to the UK and Ireland, warned that the coalition agreement seems to be bringing the country "back to square one," in that it would pit a weak coalition government against a strong and dissatisfied PTI opposition and its supporters.
Speaking to DW on Tuesday evening, Ahmed said that if Shehbaz Sharif does in fact become prime minister again, that would likely lead to Zardari becoming president once more as part of the bargain.
He said this would be perceived as a return of "the same figures that Imran Khan has been attacking as corrupt and incompetent."
"So you have Nawaz Sharif's party, the Muslim League, forming a government, but it will always be a feeble government, because it will constantly rely on its coalition partner, the PPP, who are wanting — in fact, demanding — the presidency," Ahmed said.
Ahmed also said that the fractious campaign in Pakistan and the PTI's complaints about its treatment since Khan's removal as prime minister had awoken Pakistani people's "anger," saying this anger "it was not going to disappear" unless the new government solved some glaring problems.
He listed issues including the incompetence of the civil administration, corruption and economic difficulties.
He also acknowledged the role Pakistan's influential military continues to play in politics.
"So the army is there, but invisible, as it were, but at the same time the people understand its strength and importance," he said, saying that public criticism of the military in the aftermath of last week's vote was more vocal now than in the past.
Ahead of the final results, Pakistan's powerful military called on politicians to show "political maturity and unity" and to find a way to establish a functional government despite the lack of a clear majority for any one group.