Mamnoon Hussain elected as new Pakistani president
Pakistani lawmakers have elected Mamnoon Hussain as the president to replace Asif Ali Zardari.
Mr Hussain is the candidate of the ruling PML-N party.
He faced a challenge from Wajihuddin Ahmad of the PTI. The main opposition PPP boycotted the poll in protest at the date of the vote being changed.
Pakistan's largely ceremonial president is elected by members of parliament and the four provincial assemblies. The incumbent has no political power.
Correspondents say Mr Hussain's victory was all but assured after voting began on Tuesday morning because of his party's majority in the National Assembly and the assembly of Punjab, Pakistan's most populous province.
Unofficial results on state television showed that he had won a convincing majority in both houses of the National Assembly, and is on course to win a large majority in Punjab.
Local media has reported that he is likely to secure more than 400 of the 674 electoral votes.
Mr Zardari's five-year term ends on 8 September. He replaced former military ruler Pervez Musharraf and agreed to constitutional amendments in 2010 that handed many of the president's powers to the prime minister.
Mr Zardari's main achievement is seen as having presided over Pakistan's first civilian government to serve a full term.
But his time in office was dogged by confrontation with the military and judiciary. His government did little to address mounting economic problems and the country remains beset by a Taliban insurgency.
The Pakistan People's Party (PPP) said last week that it was boycotting the elections because it had not been given enough time to campaign.
The Supreme Court had brought the vote forward from 6 August to 30 July.
Ruling party members had complained the first date clashed with the pilgrimage to Saudi Arabia marking the end of the Islamic holy month of Ramadan.
The BBC's M Ilyas Khan in Islamabad says that the outcome of the election was pretty much a foregone conclusion - and because the incumbent has little or no real power the vote itself failed to capture the imagination of the Pakistani public.
Mr Hussain, a former Sindh province governor, is seen as being close to Prime Minister Nawaz Sharif.