Islamabad, Pakistan (CNN) -- The Pakistani Supreme Court on Thursday convicted Prime Minister Yousuf Raza Gilani of contempt of court but gave him just a symbolic sentence that will not require him to serve time in prison.
The court found Gilani guilty of the contempt charge after his repeated refusals to ask Swiss authorities to revive old corruption charges against the country's president, Asif Ali Zardari. That makes him the first sitting Pakistani prime minister to be convicted of a crime.
But the court sentenced him only for the duration of the hearing, which lasted several minutes. He could have faced as much as six months in jail.
An opposition leader said Gilani should resign following the guilty verdict, but members of the prime minister's cabinet insisted he would continue in his role and appeal the decision.
The conviction means Gilani could be disqualified as prime minister, but that's a process that could take up to four months.
"I think that after the conviction the prime minister should immediately step down from his post," Nawaz Sharif, a prominent opposition leader, said on Geo TV. By remaining in power, Gilani risks harming the credibility of parliament, Sharif said.
But members of Gilani's government criticized the court's decision as being politically motivated.
"The verdict is unconstitutional and immoral," Nazar Muhammad Gondal, the federal minister for capital administration and development, said on Express News, a local channel.
"The prime minister has the confidence of the parliament, so he will continue as the prime minister," he said.
Imtiaz Safdar Warraich, the deputy interior minister, said the government planned to appeal against the verdict.
Gilani was convicted for "willful flouting, disregard and disobedience of this court's direction," said Justice Nasir ul-Mulk as he read out the decision.
The judge said that "the contempt committed by him is substantially detrimental to the administration of justice and tends to bring this court and the judiciary of this country into ridicule."
Gilani's lawyers argued that the prime minister had not followed the court's order to press for the reopening of the charges because Zardari enjoys immunity in Pakistan and abroad as a president in office.
Most observers had expected that a conviction would come without a prison sentence.
"They don¹t want to make a spectacle out of it," the columnist and analyst Muhammad Malick said earlier this week. "A prison sentence would create an unnecessary political drama."
"Time in prison would create a wave of sympathy for the prime minister, and that's something the judges don't want to see," said author and political analyst Imtiaz Gul.
This is not the first time Gilani has fallen foul of Pakistan's legal system.
He served more than five years in prison between 2001 and 2006 on corruption charges brought by the previous military regime of Gen. Pervez Musharraf -- counts he said were also politically motivated.
The corruption cases that the Supreme Court now wants reopened stem from money-laundering charges against Zardari and his late wife, former Prime Minister Benazir Bhutto. A Swiss court convicted them in absentia in 2003 of laundering millions of dollars.
After Musharraf granted a controversial amnesty in 2007 to Zardari, Bhutto, and thousands of other politicians and bureaucrats, Pakistan asked the Swiss authorities to drop the case. In 2009, the Pakistani Supreme Court ruled the amnesty was unconstitutional and called on the government to take steps to have the cases reopened.
The government did not do so, and the court lost patience. Since Gilani is the head of the government, the court justices view him as responsible.
CNN's Shaan Khan and journalist Nasir Habib contributed to this report.