ISLAMABAD-- Pakistan's top court rejected Friday a last-ditch appeal filed by the prime minister against a looming contempt charge, paving the way for a case that could plunge the nuclear-armed country into political turmoil.

The Supreme Court is demanding that Prime Minister Yousuf Raza Gilani reopen corruption proceedings against President Asif Ali Zardari. Gilani is refusing, arguing that Zardari, who also heads the ruling party of which the prime minister is a member, has immunity from prosecution while in office.

Gilani could be sentenced to prison for six months and lose his job if found guilty of contempt. This would likely be a destabilizing and drawn out process that could last months.

Since January, the case has consumed Pakistan's highly polarized political and media elite, deflecting attention from what many say are existential threats to the country like an ailing economy and a violent Islamist insurgency that shows little sign of ebbing.

Futher adding to Pakistan's troubles, relations between Islamabad and a vital donor, the United States, are at a low ebb after U.S. aircraft killed 24 Pakistani soldiers on the Afghan border last November, prompting Pakistan to close its border to U.S. and NATO supplies heading for Afghanistan.

Last week, the court ruled that Gilani would be charged with contempt next Monday. His lawyer appealed the decision but Chief Justice Iftikar Mohammad Chaudry rejected the petition on Friday.

"Our appeal has been dismissed, and as a result the prime minister will be charged with contempt of court on the 13th," Gilani's lawyer, Aitzaz Ahsan, told reporters outside the court. "God willing, on Monday he will appear."

The graft case against Zardari relates to kickbacks that he and his late wife, former Prime Minister Benazir Bhutto, allegedly received from Swiss companies when Bhutto was in power in the 1990s. They were found guilty in absentia in a Swiss court in 2003.

Zardari appealed, but Swiss prosecutors ended up dropping the case after the Pakistani parliament passed a bill giving the president and others immunity from old corruption cases that many agreed were politically motivated.

The Pakistani Supreme Court ruled the bill unconstitutional in 2009, triggering the slow moving process against the president and prime minister.

Most legal experts think Zardari would be in no immediate danger even if Gilani does as the court has demanded and writes a letter to Swiss authorities asking that they open the case against the president.

Last year, a Swiss prosecutor told the media that Geneva couldn't bring proceedings against Zardari because there he also has immunity as president of another nation. Doubts have also been raised over the statute of limitations of the 1990s case.

But having the prime minister initiate graft proceedings would carry a heavy political price for the president in a year when elections are likely to be held. Zardari himself has said the government would never write the letter. His supporters say the Supreme Court is intent on ousting him, allegedly with the consent of the powerful army, which is widely believed to want to see Zardari out of office.

Meanwhile, a separate Supreme Court commission ordered a Pakistani-American businessman living abroad to testify through a video link in another case threatening the Zardari government, a lawyer involved in the probe said.

The order gives fresh life to an inquiry that had seemed to be losing steam after its chief witness refused to travel to Pakistan, citing security threats.

Mansoor Ijaz, the U.S. national, has claimed to have delivered an unsigned memo to Adm. Mike Mullen, the top U.S. military officer at the time. The memo asks Washington to help stop a supposed military coup in the aftermath of the U.S. raid that killed al-Qaida chief Osama bin Laden.

The memo enraged the Pakistani army.

Ijaz has alleged that he did the job on instructions from the former Pakistani ambassador to Washington, Hussain Haqqani. Haqqani resigned in the wake of the scandal, but both he and the government have denied any connection to the letter.

Haqqani's lawyer Zahid Bukhari said the commission decided in a Thursday hearing to send a judge to travel to London and make arrangements for the video conference scheduled for Feb 22.