AP
In this photo released by the National Assembly, the leader of Pakistan Tahreek-e-Insaf party Imran Khan, left, greets speaker of the National Assembly Asad Qaiser in Islamabad, Pakistan, Wednesday, Aug. 15, 2018. Pakistan's lower house of parliament elected Qaiser, an ally of Khan, to be its next speaker on Wednesday, paving the way for the former cricket star and longtime politician to become the next prime minister. (National Assembly, via AP)

ISLAMABAD — Pakistani lawmakers on Friday elected former cricket star and longtime politician Imran Khan as the country's next prime minister, in a step toward the country's third civilian transfer of power.

In the vote at the National Assembly, Khan secured 176 votes, defeating the opposition's candidate, Shahbaz Sharif of the Pakistan Muslim League party, who got 96 votes.

The populist Tehrik-e-Insaf party won the most seats in the July 25 vote but fell short of securing a majority in the 342-seat house.

Khan is to be sworn in as prime minister on Saturday. His mandate lasts five years.

His supporters celebrated across the country when Speaker Asad Qaiser announced result.

In his first speech to lawmakers as premier, Khan dismissed allegations of election fraud and vowed to enforce "ruthless accountability" to combat corruption.

Khan is a former Oxford graduate and formed his party in 1996 in the eastern city of Lahore, vowing to forge a corruption-free "new Pakistan" with justice for all without discrimination.

He challenged the parties of Sharif and former President Asif Ali Zardari over the past two decades, but was not able to make a strong showing until 2013 when his became the third-largest party in the lower house of parliament. He was finally able to triumph over his opponents in last month's vote.

The elder Sharif, who served as Pakistan's prime minister three times, was disqualified last year by the Supreme Court for concealing assets abroad. Later, an anti-corruption tribunal convicted and sentenced Sharif to ten years in jail over family's purchase of luxury apartments in London.

Khan in recent years himself led widespread protest rallies against Sharif's government after the 2013 elections, alleging ballot rigging.

Sharif is the younger brother of former Prime Minister Nawaz Sharif, who is serving a ten-year jail term in a corruption case. Addressing lawmakers, the younger Sharif insisted that last month's elections were manipulated in Khan's favor.

Sharif and his supporters chanted slogans against Khan during his speech, claiming he was brought to power by the military.

Bilawal Bhutto Zardari, the head of opposition Pakistan People's Party, in his first speech as lawmaker, also claimed that the national elections were rigged "which was a shame."

Khan insisted that neither Sharif nor any other person would politically strong-arm him through protests.

Khan acquired a reputation as somewhat of a playboy during his cricketing years but has since embraced conservative Islam after entering politics.

He has married three times. His first wife was the wealthy British heiress Jemima Goldsmith, whom he married in 1996. Their two sons live with Goldsmith, who has publicly supported Khan's political ambitions and praised his skill as a leader, even after their divorce in 2004.

His married his second wife, British journalist Rehman Khan, in 2015; they divorced within a year.

Earlier this year, he married his spiritual adviser, Bushra Maneka.

In his 2011 book "Pakistan: A Personal History," Khan noted his ambition to come to power when his Islamic nation was ready to hold free and fair elections.

Aside from tackling corruption, and a vision to introduce "surgical reforms" in governance, one of the key challenges now facing Khan is how to improve ties with the United States.

Khan was elected as Pakistan's new premier a day after the Foreign Ministry confirmed the suspension of a U.S. military training program for Pakistani soldiers. Thursday's announcement underscores the persistent tensions between the two allies in the war on terror.

Comment on this story

The program is the latest to suffer from cuts to U.S. security aid to Pakistan, announced at the beginning of this year. The U.S. accuses Pakistan of harboring militant groups and providing safe havens for insurgents who carry out attacks in neighboring Afghanistan, a charge Islamabad denies.

Pakistan also repeatedly reminds the U.S. that it has lost thousands of soldiers — more than the U.S. and NATO in Afghanistan combined — in its fight against militants in its territory.

Khan had previously described in an earlier interview President Donald Trump's policies toward Pakistan as "flawed."