Pakistan's Nawaz Sharif has declared victory in the country's general elections as preliminary results showed a clear lead for his party, making it almost certain that he will become prime minister for a third time.
Turnout in Saturday's vote was nearly 60 percent, the election commission said, which according to official statistics is the highest since 1977.
The election will bring the first transition between civilian governments in a country that has been ruled by the military for more than half of its turbulent history.
Sharif, leader of Pakistan Muslim League-N (PML-N), thanked his supporters as he addressed a crowd of about 300 people at his campaign headquarters in Lahore.
“Through this vote and campaign I have felt how much love Pakistan has for me. And I have twice as much love for you,” he told his supporters.
“Thank God that he has given us the chance to help you, to help Pakistan, to help the young people. We will fulfil all the promises that we have made.”
'Programme to change'
Although results were still coming in, Sharif said he was convinced that his party would be the largest in the assembly.
“Pray that we can make a government on our own, without compromises or have to lean on anyone else. Because if we have to ask for seats, we cannot make a strong government," he said, adding that his party would hold no grudges.
“We forgive anyone who has abused us along the way…and we have not cursed anyone. We want to get Pakistan out of trouble. We have a programme to change the state of Pakistan. We must make a decision to change this country....To all other parties, I say come and sit at the table.”.
Al Jazeera's Asad Hashim, reporting from the party headquarters, said the atmosphere was festive, with supporters loudly cheering Sharif's every word.
"The mood in the PML-N camp is very much that they will be in a leading position to form the next government, even though final results are not yet in for most constituencies," he said.
With the vote count continuing into the night, PML-N was leading in 119 of the 272 National Assembly seats that were contested.
Sharif's lead means he is almost certain to become prime minister again, a triumphant return for a political leader who was ousted in a military coup in 1999, jailed and later exiled.
It remains to be seen, however, if his party will have enough legislators to rule on its own or be forced to seek coalition allies, which could make it difficult to push reforms desperately needed to revive a near-failed economy.
End to PPP rule
It appeared clear that the challenge by the party of former cricket star Imran Khan did not have the momentum needed to trip up Sharif, a moneyed political veteran who has long relied on a patronage system to win votes, especially in the key province of Punjab.
Still, Khan's Tehrik-i-Insaf (PTI) looked set to squeak into second place thanks to support from urban youths, who rallied behind his calls for an end to corruption and a halt to US drone strikes against armed groups on Pakistani soil.
|Al Jazeera's Imtiaz Tyab reports from Lahore
That marks an end to decades of two-party dominance by the PML-N and Pakistan People's Party (PPP).
Fauzia Kasuri, a founding member of Khan's PTI, told Al Jazeera: "We had expected a better result, but consider that we have nearly 40 seats, it's a big achievement. [Imran Khan] has created a sense of belonging and participation in people, particularly the youth and women of Pakistan. I think it's a terrific thing for young people.
"We will be sitting in opposition, and will be a good opposition. There are lots of challenges facing the country. I feel the role of the opposition is as important as that of the government in these circumstances."
Al Jazeera's Kamal Hyder, reporting from the city of Peshawar in Khyber Pakhtunkhwa province, said Khan did very well in that part of the country.
"His men not just swept the national poll but also the provincial assembly seats. This of course is a major success for him and his party," Hyder said.
"It must be remembered that the party did not have any representation in the parliament since, in 2008, Khan boycotted the polls. So indeed it's a big beginning for them."
Series of attacks
The run-up to the election was marred by a series of attacks targeting politicians and their supporters.
Twenty-nine people were reportedly killed across the country on Saturday, but voting proceeded peacefully at a majority of the 70,000 polling stations.
The Pakistani Taliban had vowed to disrupt the elections and claimed responsibility for several of the attacks during the campaign.
In North Waziristan, a notorious Taliban stronghold, mosque loudspeakers announced that no woman would be allowed to leave their home to vote, according to local residents. Women's turnout is traditionally low in conservative areas.
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.