On 1 August 2017, Abbasi was elected as Prime Minister of Pakistan by the National Assembly, defeating his rival Naveed Qamar of the PPP by 221 votes to 47. Jamiat Ulema-e Islam (F) and the Muttahida Qaumi Movement also supported his election. On that same day, he was sworn in as the Prime Minister in an oath-taking ceremony at the Presidency Palace. After he took charge, Nawaz Sharif decided that Shehbaz Sharif would remain in Punjab and Abbasi would continue as Prime Minister until the June 2018 general election. According to Rana Sanaullah Khan, PML-N senior leadership feared that if Shahbaz Sharif left the post of Chief Ministership of Punjab it would weaken the party's hold in the country's most populous province, which has 183 out of the 342 seats in the National Assembly and plays a crucial role in determining the successive government in Pakistan.