LAHORE, Pakistan (AFP) - Nawaz Sharif was Sunday poised to form the next government in Pakistan after declaring election victory, but was facing an uphill task in forming a coalition and tackling the country's major problems.
The partial, unofficial results represented a stunning comeback for a man deposed in a 1999 military coup, after nearly 60 per cent of the 86 million electorate turned out to vote, defying polling day attacks that left 24 dead.
The party of his main rival, cricket star Imran Khan, whose promises to end corruption struck a chord with middle-class and youth voters, conceded defeat but vowed to form the next provincial government in the northwest.
The main outgoing Pakistan People's Party appeared to have suffered a crushing defeat, going from 125 seats in the national assembly to being neck-and-neck with Khan's Pakistan Tehreek-e-Insaf (PTI), which won only one seat in 2002.
The historic polls mark the first time an elected civilian administration completed a full term to hand power to another through the ballot box, in a country where there have been three military coups and four military rulers.
Flanked by his brother Shahbaz and his daughter Maryam, a relaxed and satisfied Mr Sharif gave a victory speech to hundreds of jubilant supporters at his centre-right Pakistan Muslim League-N party headquarters in Lahore.
"We should thank Allah that he has given PML-N another chance to serve you and Pakistan," he said.
He struck a conciliatory tone following a high-voltage campaign that saw him clash with Khan, who was credited with inspiring the high turnout even if he lost one of the seats he contested in his hometown Lahore.
"I appeal for all parties to come to the table and sit with me and solve the country's problems," Mr Sharif said.
Prime minister twice before in the 1990s, his historic third term will begin only after he brokers a deal with political rivals to form a coalition.
With official results sluggish to emerge, TV projections suggested no single party would win a simple majority of 172 seats in the national assembly, raising the prospect of a weak coalition government.
Political analyst Imtiaz Gul said the result would most likely be a hung parliament in which PML-N would have to team up with their former opponents from the outgoing government.
The election was fought over the country's tanking economy, an appalling energy crisis that causes power cuts of up to 20 hours a day, the alliance in the US-led war on terror, chronic corruption and the dire need for development.
Analyst Hasan Askari told AFP that delivering a strong government would be far harder than forming a strong opposition.
"He needs to solve the issue of terrorism and other problems crippling the economy. If he delivers quickly, fair enough, if not then he will face crisis and criticism," Askari warned.
Mr Sharif has publicly called for talks with the Taleban as a means of ending a nearly seven-year domestic insurgency despite strong support from the current army chief for military action.
"I don't know what kind of approach he can adopt to challenge the Taleban, and will they negotiate with him? Will the Nawaz Sharif government bring changes in the policy on terrorism?" said A.H. Nayer.
"We will have to see if the government and the amy are on the same page on this important issue. Will there be soft and hard action as in the past or will there be negotiations and concessions?"
Chief Election Commissioner Fakharuddin Ebrahim praised the authorities, for their cooperation "which enabled us to hold free and fair elections" and recorded a turnout of nearly 60 per cent, the highest since 1977.
Both Mr Sharif and Mr Khan won at least one of the seats they had contested, but PTI, which had promised a "tsunami" of support, quickly conceded defeat.
Assad Omar, a senior PTI leader, sent his congratulations to PML-N and said Khan, who is flat on his back in hospital with a fractured spine after falling from the stage of a campaign rally, would react later on Sunday.
"I will say he knows how to win and how to lose, and after losing, how to come back. He is taking these results like a sportsman," Omar said.
Newly elected PTI member Shaukat Yousafzai said: "It is very clear that PTI has emerged as the largest party in Khyber Pakhtunkhwa, so we will form our government here with the help of like-minded political parties." Besides the 342-member national assembly, voters also elected four provincial assemblies in Khyber Pakhtunkhwa, Punjab, Sindh and Baluchistan.
More than 600,000 security personnel deployed to protect the vote and Pakistan sealed its border with Afghanistan and Iran to boost security after pre-election violence killed at least 127 people, according to an AFP tally.
In Pakistan's financial hub Karachi, voting was marred by allegations of rigging from rival parties, and the election commission ordered a re-vote in 40 polling stations in one constituency over accusations of ballot stuffing.
Islamist party Jamaat-e-Islami boycotted polls in Karachi after accusing the Muttahida Qaumi Movement (MQM), which controls the city, of fraud and violence. The MQM denied the allegations.