Pakistan's supreme court convicted the prime minister of contempt today for refusing to reopen an old corruption case against the country's president.
But Yousuf Raza Gilani was spared a prison term in a case that has stoked political tensions in the country.
The ruling against Mr Gilani appeared to be a compromise, but could still mean problems for him because he has been convicted in a court. That means he could face dismissal from office in the weeks, or more likely, months to come.
His lawyer said he would appeal against the verdict, further delaying any action that could see Mr Gilani lose his job.
Elections are scheduled for later this year or early next, meaning it is quite possible the government could see out its term with Mr Gilani still in charge.
Mr Gilani smiled when the verdict was read out in a packed court in Islamabad.
The ruling said he was guilty of contempt but would serve a sentence only "until the rising of the court", or by the time the judges left the chamber. That happened about three minutes after the verdict was handed down.
Mr Gilani is the longest-serving prime minister in the history of Pakistan, where civilian governments have repeatedly been toppled by the country's powerful military, often with the support of the supreme court, which critics allege is heavily politicised.
Corruption charges have routinely been used to target those in power, or seeking to return.
The source of the current conflict is a corruption case against President Asif Ali Zardari that involves bribes he and his late wife, assassinated 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.
Mr Zardari appealed, but Swiss prosecutors ended up dropping the case in 2008 after the Pakistani government approved an ordinance giving the president and others immunity from old corruption cases that many agreed were politically motivated.
The Pakistani Supreme Court ruled the ordinance unconstitutional in 2009 and ordered the government to write a letter to Swiss authorities requesting they reopen the case against Mr Zardari.
Mr Gilani has refused, saying the Pakistani constitution grants the president immunity from criminal prosecution while in office.