Cricket star-turned-politician Imran Khan was chosen Friday as Pakistan's next prime minister, elected on a promise to reform a system rife with corruption and traditionally controlled by the country's powerful landowners.

In the vote by lawmakers 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.

Khan's populist Tehrik-e-Insaf party won the most seats in the July 25 elections but fell short of securing a majority in the 342-seat house. He is to be sworn in as prime minister on Saturday.

Khan's supporters celebrated across the country when Speaker Asad Qaiser announced Friday's result.

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

A graduate of Oxford University, Khan 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 three-time prime minister Nawaz 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.

Nawaz Sharif was disqualified from contesting the election last year by the Supreme Court for concealing assets abroad. He is currently serving a 10-year jail term in a corruption case involving the purchase of luxury apartments in London. Opposition candidate Shahbaz Sharif is his younger brother.

Addressing lawmakers, the younger Sharif insisted that last month's elections were manipulated in Khan's favour. 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 the opposition Pakistan People's Party, in his first speech as a lawmaker, also claimed that the national elections were rigged.

Khan acquired a reputation as 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.

He 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's election as prime minister came a day after the Foreign Ministry confirmed the suspension of a U.S. military training program for Pakistani soldiers. Thursday's announcement underscored the persistent tensions between the two allies in the war on terror.

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 harbouring militant groups and providing safe havens for insurgents who carry out attacks in neighbouring Afghanistan, a charge Islamabad denies.

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