Image caption Mr Gilani refused to resign after being found guilty of contempt

Pakistan's top court has disqualified Prime Minister Yousuf Raza Gilani from holding office, two months after convicting him of contempt of court.

The Supreme Court ruled he had "ceased to be the prime minister of Pakistan".

In April, the Supreme Court convicted Mr Gilani of failing to pursue corruption charges against President Asif Ali Zardari.

The legal case is part of a bitter feud between Pakistan's civilian government and the judiciary.

In April, Mr Gilani was given only a token sentence and spared a jail term.

Tuesday's court ruling disqualified him from office and from parliament.

"Since no appeal was filed [against the 26 April conviction]... therefore Syed Yousuf Raza Gilani stands disqualified as a member of the Majlis-e-Shoora [parliament]," Chief Justice Iftikhar Chaudhry told a packed courtroom.

He added: "He has also ceased to be the prime minister of Pakistan... the office of the prime minister stands vacant."

Analysis The Supreme Court decision does not automatically lead to the fall of the government, which should have the numbers in parliament to survive. What is not clear is why it took the court two months to clarify an issue that has been dogging the country since January. Although the prime minister was convicted in April, he was sentenced to just over 30 seconds in custody, and the court had remained vague until now on his disqualification. Many believe the battle between the judiciary and civilian politicians is a political one, in which both sides have been timing their moves carefully. The court ruling comes amid fast shifting alignments between competing state institutions and politicians - and is likely to further divide an already fractious Pakistani society ahead of elections due by early next year. Much of what has happened is uncharted territory - there are few precedents to suggest what happens next.

The court backdated the disqualification to 26 April, raising questions over decisions Mr Gilani has made in office since then - including the budget.

Within hours of the order, the country's electoral commission announced that Mr Gilani had been disqualified from the National Assembly, with effect from 26 April.

Amid the uncertainty, Pakistan's main stock market fell slightly by close of business on Tuesday.

The ruling effectively dismisses Mr Gilani's cabinet as well. It is not clear what next steps Mr Gilani may take - or whether his removal means the government will fall.

The party and its allies should have the necessary majority in parliament to elect a successor to Mr Gilani.

Senior leaders of the governing Pakistan People's Party (PPP) and coalition partners spent much of Tuesday locked in emergency talks with Mr Gilani and President Zardari.

Addressing a news conference in Islamabad, PPP information secretary Qamaruz Zaman Kaira said the leadership had "sent a strict call to the party rank and file to exercise restraint and not to hold protest demonstrations".

He said the party would "decide on the next course of action after consulting coalition partners, who are meeting tonight".

Mr Kaira said the PPP had "reservations" about the court order but acknowledged that Mr Gilani "was no longer prime minister".

Ruling 'unlawful'

The BBC's Orla Guerin in Islamabad says there will be great political uncertainty following the ruling.

During Tuesday's hearing, Attorney General Irfan Qadir accused the court of behaving unlawfully.

He said the prime minister was not answerable to the court in regard to his professional duties and that justices had violated an article of the constitution in their ruling.

Image caption President Zardari is holding talks with senior members of the governing coalition

But most observers expect the PPP to avoid confrontation with the judiciary over the Supreme Court order.

"I don't see this as a major constitutional breakdown unless the PPP ignores this decision," one legal expert Salman Raja told Reuters news agency.

Mr Gilani has always insisted only parliament can remove him from office.

He decided not to appeal against the contempt conviction in April - his lawyer saying he feared a more unfavourable decision from the court if he did so.

The pursuit of the contempt case by increasingly assertive Supreme Court judges is widely seen as an attempt at meddling in the country's politics. Many believe the judiciary is being backed by the military.

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 Supreme Court ordered Mr Gilani's government to write to the Swiss authorities to ask them to reopen the cases against Mr Zardari.

But Mr Gilani refused, saying the case had been closed by a Swiss judge "on merit" and the president had constitutional immunity.