Asif Ali Zardari, the widower of former Pakistani Prime Minister Benazir Bhutto, swept to victory in a presidential election on Saturday.
Underscoring the problems he faces, a suicide car bomber killed 16 people in an attack on a police post in the northwestern city of Peshawar. At least five of the dead were policemen, and the blast wounded about 40 people.
Investors and foreign allies led by the United States hope the election will bring some stability after months of political turmoil and rising militant violence. The uncertainty has dragged stocks and the rupee sharply lower.
A former businessman, Zardari is close to the United States and has stressed Pakistan's commitment to the widely unpopular campaign against militancy.
Members of the two-chamber Parliament and four provincial Assemblies voted on a replacement for deeply unpopular former army chief Pervez Musharraf, who resigned last month nine years after taking power in a coup.
Zardari, who had been widely expected to win, secured 480 out of 702 electoral college votes, according to unofficial Election Commission results.
"It's not only a victory for Mr Zardari and the Pakistan People's Party but it's a victory for ... Benazir Bhutto's dream of a democratic political system," said Bhutto party spokeswoman Farzana Raja as party workers chanted "long live Bhutto".
Zardari's two daughters watched the vote in Parliament.
Their mother was killed in a suicide attack on Dec. 27 last year, weeks after returning from years in exile. Her party now holds the presidency and leads the government.
Zardari was a polo-playing playboy in his younger days who later spent years in prison on charges he says were politically motivated.
He will have to contend with a host of problems in the nuclear-armed US ally, including militant violence and an economy in tatters.
The bomb in Peshawar destroyed the post and brought down roofs of buildings and some people were under the rubble, said provincial police chief Malik Naveed Khan. The bomber's target was probably the provincial assembly where members were voting, he said. Pakistani Taliban claimed responsibility.
Close to US
Zardari, 53, was thrust into the centre of politics by his wife's assassination. A February parliamentary election win for their Pakistan People's Party (PPP) made him one of the most powerful figures in the country.
His decision in August to begin impeachment proceedings against Musharraf led to the latter's resignation.
His two rivals in the vote were Saeeduzzaman Siddiqui, a former judge, nominated by former prime minister Nawaz Sharif's party, and Mushahid Hussain Sayed, from the party that backed Musharraf and ruled under him.
Zardari will take office as anger with the United States is boiling after a bloody incursion by US ground troops into a remote village on the Afghan border on Wednesday.
In response to the raid, authorities blocked a major fuel supply route for Western forces in Afghanistan.
"We have stopped the supply of oil and this will tell how serious we are," Defence Minister Chaudhry Ahmed Mukhtar told Dawn Television.
Most fuel and other supplies for US forces in Afghanistan are trucked through Pakistan, crossing the border at two points, Torkham, near Peshawar, and Chaman to the southwest.
The Chaman crossing, where supplies cross into the Afghan south, was operating normally.
Zardari spent 11 years in jail on corruption and murder charges. He was never convicted and denied any wrongdoing but faces widespread doubts about his suitability to be president.
"The real test has begun. Terrorism and the economy will have to controlled and if they do, they could go a long way. But if not, they'll be out in two years," said retired teacher Sajjad Ali Shah.
Political uncertainty, exacerbated by a split in the PPP-led coalition last month, together with security and economic worries, has sapped investor confidence and dragged Pakistani stocks down 34 percent this year.
The main index rose 1 per cent on Friday, helped by optimism the vote will bring clarity. The rupee has lost 20 per cent to the dollar this year but firmed on Friday.
Dwindling foreign reserves, a widening current account deficit and sliding rupee could prompt a ratings downgrade as doubts mount over Pakistan's ability to meet external debt obligations.
But it will probably avoid sovereign debt default as its stability is such an important geopolitical factor institutions will eventually help, analysts say.
(Additional reporting by Augustine Anthony, Zeeshan Haider, Faris Ali, Imtiaz Shah, Gul Yousafzai, Mubasher Bukhari; Writing by Robert Birsel)