Pakistan crisis: Raja Ashraf voted in as prime minister
Pakistan's ruling party candidate has been elected prime minister, three days after the Supreme Court forced former PM Yousuf Raza Gilani from office.
Raja Pervez Ashraf, who won 211 votes in the 342-seat house, was a last-minute choice after a judge ordered the arrest of the preferred candidate.
But he inherits a troubled relationship between the civilian government, the judiciary and the all-powerful army.
Mr Gilani's removal from office was seen as part of a long and bitter feud.
Observers say Pakistan can ill-afford its constitutional in-fighting - the country's economy is in crisis, as are relations with the US, and militants are waging a violent insurgency in tribal areas near the Afghan border.
Mr Ashraf emerged as the likely next PM after high drama on Thursday which saw a judge issue a warrant for the arrest of the previous candidate, Makhdoom Shahabuddin, as he was filing his nomination papers.
He received 211 votes out of 342 from members of parliament. There was only one other candidate standing against him for the post. Sardar Mehtab Ahmed Khan Abbasi from the PML-N party of opposition leader Nawaz Sharif received 89 votes.
General elections are due by early next year and correspondents say that Mr Ashraf's term is likely to be troubled and short.
As with many politicians in Pakistan, the new prime minister also faces controversy.
He has been dogged by allegations of corruption relating to power projects when he was water and power minister. He denies the charges.
He is also likely to face the same Supreme Court demand as Mr Gilani for the launch of a corruption inquiry into Mr Zardari.
It was Mr Gilani's refusal to do so that led to his conviction for contempt in April and his disqualification from public office two months later. He argued the president had immunity from prosecution.
The charges against President Zardari date back to the 1990s when his late wife Benazir Bhutto was prime minister. They were accused of using Swiss bank accounts to launder bribe money.
President Zardari has always insisted the charges against him are politically motivated.
The BBC's Aleem Maqbool in Islamabad says Mr Ashraf is being seen as something of a sacrificial lamb.
The fact that he too has a corruption scandal hanging over him is for many irrelevant, our correspondent says - they see a judiciary that is now hell bent on bringing down President Zardari's Pakistan People's Party.
The PPP's main aim, correspondents say, is to see out its full five-year term, which would be a first for a civilian government in a country ruled by the military for more than half its history.
Some observers believe the PPP could benefit electorally if voters perceive it to have been persecuted by the judges and the powerful military.