Cricket star turned politician Imran Khan has declared victory for his party in Pakistan's elections.

Mr Khan, who aspires to be the country's next prime minister, said in a televised address to the nation that "thanks to God, we won and we were successful".

He added that "if God wills, we will set an example" and promised to build a "new" Pakistan.

Pakistan's election commission has not yet released official, final results but Mr Khan has maintained a commanding lead according to projections by many television stations, though it is unclear if he will have to form a collation government.

Mr Khan's message of a "new" Pakistan resonated with young voters in a country where 64% of its 200 million people are below the age of 30.

More than a dozen TV channels in Pakistan, based on official but partial counts, are projecting that Mr Khan's Pakistan Tehreek-e-Insaf party is getting as many as 119 seats of the 270 National Assembly seats that were contested.

The remainder in the 342-seat Lower House of Parliament includes reserved seats for women and minorities. Voting for two seats was postponed after one candidate died during the campaign and another was disqualified.

But before even half the votes were counted, Mr Khan's leading rival Shahbaz Sharif, who heads the Pakistan Muslim League - the party of jailed ex-prime minister Nawaz Sharif - rejected the vote, generating fears that the losers could delay the formation of the next government. Television projections give his party about 61 seats.

Mr Sharif said that "our democratic process has been pushed back by decades," adding that "had the public mandate been delivered in a fair manner, we would have accepted it happily".

Complaints have also emerged from the independent Human Rights Commission, which issued a statement saying that in some places women were not allowed to vote.

In other areas, it said "polling staff appeared to be biased toward a certain party," without naming the party.

In the days before Wednesday's election, leading rights activist IA Rehman called the campaign "the dirtiest" in his country's troubled journey toward sustained democracy.

Analysts have expressed concern that disgruntled losers could create instability for the incoming government, which will face mounting challenges - including a crumbling economy, a crippling debt and a raging militancy.

As voting got under way on Wednesday in the south-western city of Quetta, the Baluchistan provincial capital, militants sent a suicide bomber to a crowding polling station to carry out an attack that killed 31 people.

The election, in which Pakistanis voted for the National Assembly, the lower house of parliament, and the four provincial assemblies, marked only the second time in Pakistan's 71-year history that one civilian government has handed power to another in the country of 200 million people.

Yet there have been widespread concerns during the election campaign about manipulation by the military, which has directly or indirectly ruled Pakistan for most of its existence. The military had deployed 350,000 troops at the 85,000 polling stations.

Pakistan's military spokesman General Asif Ghafoor called accusations of interference "malicious propaganda".

Throughout the night and into Thursday, Mr Khan's supporters celebrated outside party offices countrywide. Most of the revellers were young men, who danced to the sound of beating drums draped in Tehreek-e-Insaf's black and green-coloured flags.