Image caption Mr Hussain is known for his loyalty to the PML-N party

Pakistan's new president Mamnoon Hussain has been sworn in at a ceremony in the capital, Islamabad.

He replaces Asif Ali Zardari who stood down on Sunday after becoming Pakistan's first democratically elected president to complete a full term.

Mr Hussain, a businessman, is a close ally of Prime Minister Nawaz Sharif.

The largely ceremonial post of president is elected by members of parliament and provincial assemblies, but has little political power.

The swearing-in of Mamnoon Hussain came as party leaders backed the government's efforts to negotiate with militants.

Since assuming power in June, Mr Sharif's government has been trying to build a consensus on how to deal with militants. There appears to be a wider agreement on drawing the Pakistani Taliban into peace talks, but there is also the nagging reminder that such talks have not worked in the past. So how to make it different this time? There has been talk of a pre-condition that first the Taliban disarm, or at least declare allegiance to the Pakistani constitution which they have so far rejected as "secular" and un-Islamic. If there is no such condition, the politicians will have to evolve a mechanism to make sure that the militants don't use the talks to legitimise their position and reinforce their ranks. A bigger question is, if talks don't work, will the military launch new offensives against the militants? If so, how will it separate the highly inter-changeable cadres of the groups Pakistan wants eliminated and those it still considers crucial to its strategic aims in the region? The recommendations of today's conference will throw some light on the extent to which Mr Sharif's government will be able or willing to go after the militants.

Military and intelligence chiefs briefed politicians during the talks on security strategy, which were chaired by Prime Minister Nawaz Sharif.

"We have to rise above politics on some issues and develop a national consensus for the sake of this country," Mr Sharif told those gathered as talks opened.

In a closing statement, the parties agreed that talks with militants should be pursued as a first option, before any new military action by the Pakistani army. US drone strikes against the Taliban were also condemned.

"We declare that we shall ourselves determine the means and mode of fighting this war in our national interest and shall not be guided by the United States of America or any other country in this regard," the statement added.

Mr Hussain, 73, took the oath of office in a ceremony presided over by Pakistan's Chief Justice Iftikhar Chaudhry.

He was a surprise candidate for the ruling PML-N party but once nominated his election was a foregone conclusion, correspondents say.

A businessman from Karachi and former state governor, he is known for his loyalty to the PML-N and many feel this made him a trusted candidate for the post.

He takes over from Mr Zardari, who received a guard of honour from the armed forces as he ended his term in office on Sunday.

The 58-year-old widower of former Prime Minister Benazir Bhutto succeeded former military ruler Pervez Musharraf and agreed to constitutional amendments in 2010 that handed many of the president's powers to the prime minister.

His main achievement, many say, was presiding over Pakistan's first peaceful transfer of power between two democratically-elected governments.

But his time in office was dogged by confrontation with the military and judiciary.

Analysts say his government did little to address mounting economic problems and the country remains beset by a Taliban insurgency.