There is a long road ahead before the new leader can set out on his agenda, reports Ben Farmer in Islamabad
A political winner at last, Imran Khan begins Pakistan coalition building
Imran Khan's party has opened talks with independents and small parties to form a coalition government in Pakistan but his political rivals are considering protests over alleged vote rigging.
Mr Khan, 65, a national sporting icon who turned to politics on an anti-corruption ticket after his famed cricket career, came first with 116 seats in Wednesday's election but fell short of the 137 needed for a simple majority.
The latest tally, updated on Saturday afternoon following long delays, showed the Pakistan Muslim League-Nawaz (PML-N) party of ousted prime minister Nawaz Sharif in a distant second place with 64 seats.
Mr Khan's is now looking for potential coalition partners, according to spokesman Fawad Chaudhry, a task that analysts said should be straightforward.
"We have contacted small parties and independent members, they will soon meet party leaders in Islamabad," Mr Chaudhry said late Friday, adding that the process was likely to take about 10 days.
His comments followed an announcement by defeated parties of plans to launch a protest movement, after foreign observers voiced concerns about the contest.
More than a dozen parties calling themselves the All Parties Conference (APC) promised to demonstrate.
However the group remained divided with some parties pledging to boycott joining the National Assembly and others calling for a new vote.
Mr Khan's lead is big enough that he can avoid messy negotiations with large rivals and instead call on independents and minor groups.
The PML-N rejected the results but did not say they would boycott the country's new parliament. Parties have complained their monitors were kicked out during counting and results have been delayed.
Pakistan's electoral commission has said a faulty computer system was to blame for late results.
However the country's Free and Fair Election Network said in a preliminary report that polling day was “better managed, relatively peaceful and free of any major controversy” until the late night allegations over the counting process surfaced.
Mr Khan's comrades from the Pakistan 1992 World Cup winning team paid tribute to their former captain.
"Congratulating the new Prime Minister of our country," said ex-bowler Wasim Akram.
"It was in your leadership skip that we became world champions in 1992. It is in your leadership that we can again become a great democratic country.”
Fellow bowler Waqar Younis praised the leader-elect's first speech to the nation, in which he said he wanted closer ties with India and more equal ties with America.
Younis said: "A special speech from a great leader..Very simple, honest and practical. Feeling so proud to be a student of such a mentor. congratulations skipper," he said.
Retired general and analyst Talat Masood said the APC may succeed in sparking pockets of unrest in its planned demonstrations without upsetting national stability.
"Opposition parties are divided and they are not genuinely in a mood to form any major opposition. I don't think they have this stamina and the support of the people for going for a big movement," he said.
The protests announcement late Friday came as the United States, the European Union and other observers aired reservations over widespread claims that the powerful military had tried to fix the playing field in Mr Khan's favour, an allegation both deny.
Mr Khan spoke on Thursday from his Bani Gala estate outside Islamabad to set out his policy platform for government.
The statesman-like speech repeated his campaign vows to curb corruption and strengthen institutions.
"Today in front of you, in front of the people of Pakistan, I pledge I will run Pakistan in such a way as it has never before
He also said he wanted to reset relations with India, which are blighted by a long-simmering row over Kashmir. The two nuclear-armed powers are barely on speaking terms and skirmishing and shelling along the disputed line of control regularly kills civilians on both sides.
"If India takes one step towards us, we will take two steps towards them. Right now, it is one sided where India is constantly just blaming us.”
"The leadership of Pakistan and India now need to come to the table to resolve this and end blame games."
He even suggested an EU-style open borders agreement with Afghanistan.
The Pakistan People's Party (PPP) of assassinated former prime minister Benazir Bhutto came third in the election.
However the broader significance of Mr Khan's victory is that it represents an end to decades of rotating leadership between the PML-N and the Bhutto dynasty's PPP – now led by her son Bilawal – that was punctuated by periods of military rule.
The vote was meant to be a rare democratic transition in the Muslim country, which has been ruled by the powerful army for roughly half its history.
But it was marred by violence and allegations of military interference in the months leading up to the vote, with Mr Khan seen as the beneficiary.
Despite the PML-N vote collapsing nationwide, it remained the largest party in its Punjab heartland. It it takes power of the provincial assembly in the country's most populous province, it could form a major seat of opposition to Mr Khan's proposed reforms.
The former cricket star will face myriad challenges, including militant extremism, an economic crisis with speculation that Pakistan will have to seek a bailout from the International Monetary Fund, water shortages and a booming population.
He will also have to contend with the same issue as many of his predecessors: how to maintain a balance of power in civil-military relations.