The Supreme Court of Pakistan has tossed out an appeal by Prime Minister Yousuf Raza Gilani designed to avoid appearing before the court in connection with an ongoing contempt case.

The court will likely charge Gilani with contempt in a few days for his refusal to commence an investigation into alleged corruption by President Asif Ali Zardari.

“The appeal is dismissed and the court can go to any extent to implement its verdict, said Chief Justice Iftikhar Muhammad Chaudary, who heads an eight-judge panel hearing the appeal.

The order is found to be strictly in accordance with the law and principles of criminal administration of justice and therefore no interference is called for. No one wants unrest. We are exercising restraint.”

Chief Justice Chaudary also told Gilani’s attorney, Aitzaz Ahsan: Tell the prime minister this is not in the interests of the country [to defy the court order].

Gilani has long contended that Zardari – as the sitting head of state – is immune from prosecution.

Zardari himself has denied the corruption allegations and insists that the measures against him are politically motivated.

The deepening drama highlights the growing rift between Pakistan’s civilian government and the judiciary. Pakistan’s powerful military is also believed to be supportive of the court’s actions -- perhaps because it would hasten the downfall of Zardari.

In the event Gilani is imprisoned, the elected government would be compromised, although it probably wouldn’t completely collapse. However, such a dishonor might imperil the chances of the ruling Pakistan Peoples Party in next year’s elections.

A correspondent for Al Jazeera in the Pakistani capital, Islamabad, Imtiaz Tyab, reported that if [Gilani] is indeed convicted of this, this could cause a real problem here in Pakistan and fresh political turmoil. [Gilani] could face up to six months in prison and be disqualified from office. It's very unlikely that the prime minister will ever do anything against the president.”

The corruption issue is traced back to a controversial amnesty law that was passed in 2007 under the rule of former President Pervez Musharraf which threw out hundreds of corruption investigations related to prominent Pakistani lawmakers and businessmen, including Zardari. The deal was made in connection with the return to Pakistan of former Prime Minister Benazir Bhutto, Zardari’s wife, from self-imposed exile.