BBC:–  Former cricket star Imran Khan has been elected prime minister of Pakistan in a vote at the country’s National Assembly.

His PTI party won the most seats in July’s elections – setting up Mr Khan to become PM with the help of small parties, more than two decades after he first entered politics.

He will be sworn in on Saturday.

Mr Khan, 65, will inherit a country with a mounting economic crisis and he has vowed to create a “new Pakistan”.

The charismatic sports star, who captained Pakistan to a World Cup victory in 1992, has long shed his celebrity playboy image and now styles himself as a pious, populist, anti-poverty reformer.

He ran on an anti-corruption platform that pledged to improve the lives of the country’s poor with an “Islamic welfare state”.

In Friday’s vote, Mr Khan was backed by 176 members. His opponent, Pakistan Muslim League-Nawaz (PML-N) president Shahbaz Sharif, received 96 votes.

Speaking after the results, the prime minister-elect vowed to bring about the “change that this nation was longing for”, according to local media.

He promised “strict accountability” for those who had “looted this country”.

“I did not climb on any dictator’s shoulders; I reached this place after struggling for 22 years.”

Opposition parties have claimed elements of last month’s elections were rigged. Despite this, they agreed to take their seats in the assembly.

In the lead-up to the election, Mr Khan was widely seen as the favoured candidate of the powerful military, which was accused of meddling against his rivals.