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.

But the problem now Imran Khan will now have to focus on Pakistan’s rapidly deteriorating finances as the U.S. continues to pressure the nuclear-armed nation over its alleged support for insurgent groups. 

After galvanising voters, particularly Pakistan’s large young electorate, Khan’s Pakistan Tehreek-e-Insaf has made promises to both expand social spending, while attempting to fix the economy and rebuild the nation’s depleted finances. Despite forming a majority with the support of independents and several smaller parties, Khan’s ability to govern and push through reforms will continue to be tested.

It is only the second successful, consecutive transfer of power between civilian governments in a country that has been ruled directly by the military for almost half its 71-year existence.

Khan’s party has already flagged that urgency is needed to deal with Pakistan’s dwindling reserves, which have dropped at the fastest pace in Asia this year to $10.4 billion. The nation’s current-account deficit has widened by 42 percent to $18 billion in the year through June.

17081810

Asad Umar, a senior PTI lawmaker and the incoming finance minister, said in an interview this month that Pakistan may need more than $12 billion to plug the finance gap and a decision on where to source funds needs to be made by September at the latest.

Many investors, analysts and politicians expect most or part of that will come from an International Monetary Fund bailout. With Pakistan a key country along its Belt and Road trade route, China has also been providing the South Asian nation with billions of dollars in stop-gap loans this year.

Those vast debts to Beijing have prompted worries from U.S. Secretary of State Mike Pompeo, who said last month he would be watching to see if Khan’s new government uses IMF funds to pay off the opaque Chinese loans. Umar said he would bring more transparency to the more than $60 billion Belt and Road infrastructure projects in Pakistan.

During his victory speech on July 26, Khan called for closer ties with China and said he wanted a more “mutually beneficial” relationship with Washington. His comment comes after President Donald Trump cut Pakistan’s military aid and a U.S. push saw the country added to a global anti-money laundering and terror financing agency in June.