Pakistan's parliament has approved Nawaz Sharif as prime minister after his surprise landslide victory in general elections last month.
Mr Sharif received 244 votes in the 342-seat parliament, returning him to office for an unprecedented third time.
The newly appointed leader is due to be sworn in later on Wednesday.
He faces numerous pressing challenges, including reviving a weak economy and putting an end to militant attacks and US drone strikes.
The BBC's M Ilyas Khan in Islamabad says Mr Sharif's priorities will be rejuvenating the economy and improving security - both areas that require some speedy but difficult decision-making in a geo-strategic environment which is shaped and controlled by the military.
While the new prime minister favours talks with the Pakistani Taliban, many expect that once he gets into power, he will accept the army's view that all past negotiations have failed and the only option is to fight the jihadis who attack domestic targets.
He comes to power at a critical time in the battle against the Taliban - as Nato forces begin the process of withdrawing from Afghanistan.
Mr Sharif has continually spoken out against US drone strikes in Pakistan although it is not clear how he can bring these to an end.
Infrastructure projects are another important priority - he wants to stop power cuts and construct a bullet train between Karachi and Peshawar.
Because his PML-N party has an outright majority in parliament - with the support of some independent MPs - the prime minister does not need to form a coalition.
He is expected to address parliament after being elected its leader but is not expected to go into policy details.
The ceremony is being attended by members of parliament, foreign diplomats and dignitaries, senior members of the judiciary and chiefs of the armed forces.
Although other candidates from the Pakistan People's Party and from Imran Khan's Pakistan Tehreek-e-Insaf party were standing against him, Mr Sharif's nomination was a formality because of the commanding majority of his party in parliament.
President Asif Ali Zardari - his old political rival - will administer the oath to him. He is also likely to swear in key members of Mr Sharif's cabinet.
PML-N sources are reported in the Pakistan media as saying that the new prime minister wants to compose a cabinet of fewer than 24 ministers but at the same time is under pressure to have representatives from all the country's provinces within it.
Correspondents say that Mr Sharif's task is all the more complicated because most PML-N members come from Punjab province.
On Monday, the PML-N's Sardar Ayaz Sadiq was elected as the 19th speaker of the National Assembly after securing 258 of 312 valid votes.