ISLAMABAD, Pakistan (CNN) -- Asif Ali Zardari, 53, had been the front-runner in the race to replace former President Pervez Musharraf, who was forced to resign last month.
The election was not by public vote, but rather by lawmakers in the two houses of the National Assembly and in the four provincial assemblies around the country. Under Pakistan's constitution, the president is elected by a majority vote.
Pakistan's PTV reported that in parliament, Zardari received 281 votes. Retired Chief Justice Saeed-uz-Zaman Siddiqui received 111 votes and Senator Mushahid Hussein received 34, PTV reported.
The pro-American Zardari will rule a nuclear power threatened by Islamic militancy and economic turmoil. The Taliban are resurgent in Pakistan and the country's economy is tanking.
Zardari took over Bhutto's Pakistan People's Party (PPP) after her death late last year. His party had been confident of a win, saying Zardari had the support of three of the four provincial assemblies -- which would be crucial in helping Zardari forge the alliances he needs to tackle the country's main problems.
Hussain, who was a close aide to the ex-president, was representing Musharraf's Pakistan Muslim League-Q. The party had painted him as a candidate who represented the middle class and has a clean track record -- in contrast to Zardari, who spent 11 and a half years in jail on corruption charges that he refutes.
Siddiqui was nominated by the Pakistan Muslim League-N (PML-N), led by former Prime Minister Nawaz Sharif.
Musharraf resigned under intense political pressure last month as the ruling coalition began taking steps to impeach him. He had swept to power in 1999 in a bloodless coup.
The chairman of the upper house of the assembly, Mohammedmian Soomro, has been acting president in the meantime.
Saturday's election came one day after Pakistan's Supreme Court reinstated three of its judges who Musharraf ousted in November, following his imposition of emergency rule.
The PPP had formed a coalition with Sharif's party, the PML-N, but the coalition split apart August 25. The PML-N had set that date as a deadline for the government to honor its promise to reinstate the judges who were fired.
The PPP, which led the coalition, said it believed the coalition should focus on picking a successor for Musharraf before it decided on reinstating the judges.
At least 60 judges were arrested after Musharraf issued his order. Some were jailed, others placed under house arrest.
Security around the National Assembly building in Islamabad was tight, with police on the roof and at the gates and riot police on site.
As the voting took place, a suicide car bomb exploded in northwestern Pakistan, killing 16 people, including 10 police officers, a local police spokesman said. Fifty others, mostly civilians, were wounded.
The explosion happened at a checkpoint on the outskirts of Peshawar, the capital of Pakistan's North West Frontier Province. The province is near Pakistan's border with Afghanistan and is rife with Islamic extremists.