Imran Khan smiles moments after being announced as the prime minister-elect. ─ DawnNewsTV

Pakistan Tehreek-i-Insaf (PTI) Chairman Imran Khan was elected Pakistan's 22nd prime minister on Friday, marking the pinnacle of his 22-year-long political career.

Khan clinched victory with 176 seats while his opponent, PML-N President Shahbaz Sharif, secured 96 votes in the polling that took place in the National Assembly today.

As the newly elected speaker of the assembly, Asad Qaiser, announced the results, the House erupted with chants of "na manzoor" [unacceptable] and "Wazir-i-azam Nawaz Sharif" [PM Nawaz Sharif]. The protests by PML-N leaders continued nearly all the way through the session despite the speaker's attempts at restoring order in the House.

PML-N lawmakers protest after announcement of results. ─ DawnNewsTV

Khan, in the meantime, sat smiling in his seat, accepting congratulations from his party members.

The speaker had suspended the proceedings of the National Assembly for 15 minutes after the crucial announcement due to the persistent sloganeering of PML-N legislators. Announcing the suspension of proceedings, Assembly Speaker Qaiser asked parliamentary leaders to come to his chamber.

When the session resumed, the speaker asked the PM-elect to address the House as protests — by PML-N — and cheering — by PTI — continued.

'Only Jinnah struggled more than I did'

Prime Minister-elect Imran Khan, in his first speech following his victory, promised "the change that this nation is starving for".

"We have to have strict accountability in this country; the people who looted this country, I promise that I will work against them," he asserted.

"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, Jinnah. Twice every month I will answer to the people during the question-answer session in the assembly."

"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," said a charged Khan, moving on to address allegations of election rigging.

PM-elect Imran Khan addresses the parliament amid chaos by opponents, cheers by supporters. ─ DawnNewsTV

"I want to ask the people who are yelling here why they didn't investigate the four constituencies that I asked for.

"Why didn't they investigate then? Why didn't they hold people accountable? Why didn't the [PML-N] government take action?"

"When I was asking for investigation, these people accused me of being a planted by the establishment," Khan continued.

"We [government] will cooperate with you [PML-N] even if you want to take your complaints to the Supreme Court. You can make as much noise as you want or even hold a dharna — we will provide you the container and food for it."

Khan's oath-taking ceremony will take place tomorrow.

The former cricketer was tipped as the 'PM-in-waiting' soon after the July 25 polls in which PTI won more seats than other political parties.

'We will hold you accountable'

A visibly disconcerted Shahbaz Sharif then took the microphone, focusing primarily on the allegations of rigging in the July 25 polls.

"Throughout the world, newspapers and outlets are raising accusations of rigging in the general elections," he said.

"This is the worst election in history in terms of rigging; the authorities must act against those responsible."

"What kind of election was this?" he questioned amidst loud chants echoing across the hall.

"The Result Transmission System (RTS) [on the night of July 25] was forcefully shut down. What kind of elections were these that the results were delayed for 48 hours?"

Alleging that 1.6 million votes were rejected, he questioned the discovery of ballot papers from gutters and streets across the country.

The former Punjab chief minister urged the Election Commission of Pakistan (ECP) to "submit a report before this House" adding that "the clauses that need amendment in the Election Act 2017 must be amended so no one can rob the vote of its sanctity".

He threatened that opposition parties would "take to the streets" if a commission was not formed and justice not served.

Reminding the PM-elect of a promise he had made in his first address to the nation after the July 25 polls, Sharif said: "Khan sahab, you had said that if rigging in 2013 elections would be proven, Nawaz Sharif's government should resign. We will not let you run from this. We will hold you accountable for stealing votes."

Clarifying the party's stance and objectives, he said: "We came here for the sake of democracy and to protect the democratic system. There have been movements in the past and we have always stood by this House."

"No matter what we do, we will not curse this parliament, we will not attack this parliament," he added.

Sharif refused to conclude his speech "in protest" after being silenced by the speaker so that Bilawal Bhutto could also address the House.

'Khan will have to go through us if he continues fanning flames of hate'

PPP Chairman Bilawal Bhutto, in his first address to the National Assembly, delivered a measured and mature speech in English.

Although he said it was his "honour to become a part of this house", the 29-year-old criticised the "two biggest parties for creating a ruckus" in the parliament.

He remembered those who lost their lives in terror attacks in Peshawar and Quetta in the run-up to the July 25 polls.

Bilawal said that his party had its reservations over both the pre- and post-polling procedures but still "decided to be a part of this house to support this fragile democracy."

"If it weren't for us Mr Speaker, you wouldn't have your seat and the PM would not have his," he added.

"We would have been facing a constitutional crisis and we must assess what it cost for Khan sahab to get here. We mainstreamed extremism, we compromised on our basic rights, we pitted one Pakistani against another," he continued.

"Our prime minister-elect has promised a 100-day roadmap. I want to see how he creates 10 million jobs, ends poverty."

"I would like to ask Khan sahab ─ who said that he would rather commit suicide than go to the IMF and beg for alms ─ what his plan will be to deal with the economic crisis."

"It is hurtful that Pakistan, which has sacrificed so much in the fight against violent extremism, is seen as a part of the problem and not as part of the solution," he went on.

"I am sure the new government will take the [necessary] steps. However Khan sahab got here, Mr Speaker, he is now the prime minister of this worthy nation."

"I want to remind him that he is not one party's prime minister. He is the prime minister of all Pakistanis ─ even those he called living corpses, the ones he called donkeys, the ones he referred to as sheep and goats."

"As prime minister, I hope Imran Khan will drop the hateful rhetoric. If he continues to fan the flames of hatred, he will have to go through us and he will find us opposing him at every step of the way," he vowed.

"If the prime minister-elect makes constitutional supremacy and human development his priorities, we will stand by his side," he added.

"I congratulate the prime minister-select," he concluded, with his use of the word "select" possibly referring to allegations of poll engineering.

Following Bilawal's speech PTI Vice Chairman Shah Mahmood Qureshi also addressed the newly formed parliament.

He accused the PML-N of breaking the agreement that the opposition and the ruling parties had made to allow Khan to deliver his full speech.

"Every party stood by its word except the PML-N," Qureshi said. "Of course why would they? The session was being broadcast live so there was a photo opportunity.

"Imran Khan wanted to say that 'I will present myself in front of the nation'. He wanted to invite everyone to sit together but sadly you did not have the courage to listen to him."

Qureshi then struck a conciliatory tone and asked the opposition to "play the role of a constructive opposition.

"Let's change our behaviour towards each other. We will try to incorporate your criticism in our policies. We must also have the courage to listen to criticism."

"We are aware of the challenges that the country is facing. We will solve them together."

Lawmakers arrive, session begins after delay

The session kicked off around 4:30pm ─ an hour later than expected ─ with all lawmakers seated under the chairmanship of the assembly speaker. The delay was attributed to overcrowding in the press gallery, according to media reports.

Bilawal Bhutto Zardari converses with other lawmakers ahead of the vote. ─ DawnNewsTV

Khan arrived at parliament well ahead of the scheduled polling time. By 3:30pm, Sharif had also arrived at the venue, but did not make an appearance in the assembly until after 4:14pm.

Sharif, flanked by other PML-N MNAs, walked into the House with a black band around his upper arm in protest against alleged rigging in the election.

Shahbaz Sharif and Imran Khan shake hands before the start of voting. ─ DawnNewsTV

Despite the PPP's boycott of today's vote, chairman Bilawal Bhutto Zardari was also in attendance.

Shahbaz shook hands with both Imran and Bilawal on his way to the benches.

PML-N protests

As the session opened, PML-N's Murtaza Javed Abbasi took strong issue with the manner in which "the sanctity of the House was violated".

"The voting for PM has not even started yet and the sanctity of House is already being violated, we register protest," he said, adding: "The government that was installed by khalai makhlooq has not even taken power yet."

NA Speaker Asad Qaiser attempted to restore order in the House as PML-N leaders voiced their objections to what they alleged was "engineering" in the July 25 polls.

As disturbance rippled through the House, Qaiser warned lawmakers that he would expel anyone who disrupted the session.

Chanting and sloganeering continued as the speaker read out the procedure for election of the prime minister and then the names of the two nominees. He directed those voting for Khan to the lobby on his right, and those voting for Sharif to the lobby on his left.

According to DawnNewsTV, PML-N leader and former assembly speaker Ayaz Sadiq had made a last-minute attempt to convince PPP Chairperson Bilawal Bhutto-Zardari ─ whose party earlier announced it would abstain from voting ─ to support Shahbaz Sharif as voting was underway.

After the newly elected MNAs finished casting their votes for the two contenders, a count took place and Khan was announced as the victor.

The two contenders

After the PTI emerged as the biggest parliamentary party in the wake of the July 25 polls, all 120 of the party's parliamentary committee members rubber-stamped Khan's candidacy for the post of the prime minister.

Read: Imran Khan: Creating the biggest political storm of the year

The PTI had, on its own, bagged 116 NA seats in the election before recruiting nine additional independents, which took its tally to 125.

The party was subsequently allotted 33 reserved seats by the Election Commission of Pakistan last week, which sent its tally to 158.

However, that tally was trimmed as Khan, a winner on five NA seats, kept only his Mianwali seat and vacated the other four. Ghulam Sarwar Khan and Tahir Sadiq also had to leave one of the two NA seats they had bagged each, cutting PTI's lead by six.

PTI Spokesperson Fawad Chaudhry had earlier claimed that his party, with the help of its allies, had garnered the support of 180 plus NA members — at least eight more than required for a simple majority and enough to get Khan elected PM in the first poll.

However, PML-Q, a key PTI ally, has also seen its quartet of NA seats reduced by half as their party leader Chaudhry Pervaiz Elahi — a candidate for the Speaker of Punjab Assembly — also vacated both his seats in the lower House of the parliament.

The PTI's perceived struggle in establishing its dominance had offered a glimmer of hope to Shahbaz Sharif — the opposition's joint candidate for the PM's gig.

Related: Alliance unravels as PPP refuses to vote for Shahbaz

The decision to nominate him was made as part of an agreement between the three main opposition parties — the PML-N, PPP and the MMA-P — during an All Parties Conference.

However, less than 24 hours before the election, PPP decided to “abstain” from today’s vote due to refusal of the PML-N to replace its candidate, making the contest a one-sided affair.

Sources told Dawn that using backdoor channels, the PML-N had contacted the PPP leadership many times throughout the day on Thursday, asking it to review its decision in the larger interest of the opposition’s unity — but the PPP refused to reverse its decision.

The eleventh-hour rift and retraction further dented whatever chance the joint opposition had against Khan.