Mr Khan, 65, and his party swept to victory in July’s general election, on a platform of fighting corruption and lifting millions of people out of poverty, while creating an “Islamic welfare state”.
In Friday’s vote, Mr Khan was supported by 176 National Assembly members. Shehbaz Sharif, his opponent and president of the Pakistan Muslim League-Nawaz (PML-N), received 96 votes.
He will be sworn in on Saturday and is yet to announce his cabinet.
Bitter political divisions and economic instability have plagued Pakistan, with opposition lawmakers surrounding the prime minister-elect shouting “thief, thief Imran Khan” after he was voted in.
Speaking after the announcement of the results, Mr Khan vowed to bring about the “change that this nation was longing for”, according to local media.
For those who had “looted” the country, he promised “strict accountability”.
He said: “I did not climb on any dictator’s shoulders, I reached this place after struggling for 22 years.”
The sports star’s party, Pakistan Tehreek-e-Insaf (PTI), holds 151 seats in the 342-seat lower chamber of parliament, which is short of a majority, but Khan expected to form a coalition government with smaller parties.
Mr Khan’s success ends decades of political dominance by two dynastic powerhouses, the Pakistan Muslim League-Nawaz (PML-N) of three-time premier Nawaz Sharif, who is now in prison, and the Pakistan Peoples Party (PPP), founded and led by the Bhutto family.
Khan’s rise to power has been belittled by opposition parties, who claim his accession was made easier by allusive support of Pakistan’s powerful military, which has ruled the country for nearly half its history.
PML-N politician, Murtaza Abbasi, made a euphemistic statement in parliament when he said that Mr Khan was “brought here by aliens”, implying the military had assisted him. Other opposition politicians shouted “puppet prime minister”.
Editor of the Daily Times newspaper, Raza Ahmad Rumi, said: “Legislative business will be difficult for him.”
Both the army and PTI deny the allegations.