In a one-sided election in the National Assembly, Imran secured 176 votes while his only rival and Pakistan Muslim League-Nawaz chief Shahbaz Sharif got 96 votes.
Imran Khan was voted as Pakistan's new prime minister on Friday in a one-sided election in the National Assembly, nearly 22 years after the former cricket hero entered politics, promising to act against those who "looted" the country.
The election for the top post became just a formality after the Pakistan Peoples Party led by Bilawal Bhutto Zardari with 54 seats abstained from voting following a rift over the Pakistan Muslim League-Nawaz chief Shahbaz Sharif's candidature.
Khan, 65, the chairman of the Pakistan Tehreek-e-Insaf, secured 176 votes while his only rival Shahbaz Sharif got 96 votes, National Assembly Speaker Asad Qaiser said while announcing the result.
A total of 172 votes in the 342-member lower house of parliament are needed to form a government.
After the announcement of the result, PML-N lawmakers chanted slogans against Khan and protested in the house.
PML-N supporters, who were carrying posters with picture of jailed former prime minister Nawaz Sharif, raised slogans including: "Vote ko izzat do" (Give respect to vote).
The protests by PML-N lawmakers continued as Speaker Qaiser tried to restore order in the house. The speaker then suspended the proceedings for 15 minutes.
When the session resumed, Speaker Qaiser asked Prime Minister-elect Khan to address the house.
In his first address to parliament, Khan vowed to act against those who looted Pakistan.
"I promise my nation today that we will bring the tabdeeli (change) that this nation was starving for," said Khan.
"We have to hold strict accountability in this country; the people who looted this country, I promise that I will work against them," he vowed.
"The money that was laundered, I will bring it back the money that should have gone towards health, education, and water, went into people's pockets," Khan said.
"You can make as much noise as you want or even hold a dharna, we will provide you the (cargo) container for it," he added.
Khan said that he brought neutral empires in the international cricket and would work to create an electoral system so that nobody could find faults with elections in the future.
"But nobody should try to blackmail me," he said, as he offered to cooperate with the opposition to probe the allegations of rigging.
The Oxford-educated Pashtun, who launched Tehreek-e-Insaf, which means the movement for justice, in 1996, said that he reached this place after struggling for 22 years.
"I did not climb on any dictator's shoulders; I reached this place after struggling for 22 years. Only one leader struggled more than me and that was my hero, (Pakistan's founder Mohammad Ali) Jinnah," Khan said.
In an indirect reference to Nawaz Sharif who was convicted in a corruption case, Khan said he will not show any leniency toward any "dacoit".
Khan will take the oath on Saturday as Pakistan's 22nd prime minister.
In his address, Shahbaz Sharif said that the elections were rigged to ensure the victory of PTI and demanded a fair probe by parliament.
"I demand that a parliament commission should be set up to investigate the rigging," he said.
He warned to launch protest if the government failed to probe the fraud in elections. He also said that his elder brother Nawaz Sharif was wrongly convicted and disqualified.
Earlier, the voting was held in open through division of members in different galleries designated for different candidates.
The PPP lawmakers remained seated during the voting process.
The Jamaat-i-Islami also did not take part in the voting.
In a last-ditch effort to pursue the PPP to vote for Shahbaz Sharif, senior PML-N leader and former speaker Ayaz Sadiq went to Bhutto's seat and tried to convince him to change his decision to abstain from voting, sources said.
Even Shahbaz Sharif spoke to Bhutto to persuade him not to abstain.
However, Bhutto excused himself from voting, they added.
Shahbaz Sharif, the 66-year-old younger brother of jailed former prime minister Nawaz Sharif, served as the chief minister of the politically crucial Punjab province from 2013 to 2018.
He became PML-N president after his elder brother was barred from holding the top party position and public posts.
During the voting, Khan received support of smaller parties including Muttahida Quami Movement with seven seats, Balochistan Awami Party five, Balochistan National Party four, Pakistan Muslim League three, Grand Democratic Alliance three, Awami Muslim League and Jamori Watan Party one seat each.
PML-N lawmakers including Shahbaz Sharif arrived in the National Assembly wearing black armbands to protest against alleged "rigging" of the votes during the July 25 general elections.
Sharif and Khan greeted each other and shook hands prior to the start of the session.
The PTI emerged as the single largest party with 116 seats in July 25 elections. Its number increased to 125 after nine independent members joined it and final tally reached 158 after it was allotted 28 out of 60 seats reserved for women and five out of 10 seats reserved for minorities.
Khan's government will be the third consecutive democratic government in Pakistan since 2008 when military ruler Gen Pervez Musharraf announced elections after serving as president from 2001 to 2008 following a bloodless coup in 1999.
The PPP formed the government in 2008, followed by the PML-N led by jailed former prime minister Nawaz Sharif in 2013.
Pakistan's powerful military has ruled the country through various coups for nearly half of the country's history since independence in 1947.