ISLAMABAD – Pakistan's Supreme Court Friday struck down a law designed to protect the new prime minister from being charged with contempt and thrown out of office like his predecessor. The ruling was the latest twist in a long-running saga that pits the country's judiciary against its ruling party, a showdown that many analysts say endangers Pakistan's fragile democracy. The court ousted the previous prime minister, Yousuf Raza Gilani, from office in June by charging him with contempt of court for failing to reopen corruption proceedings against President Asif Zardari. The court gave the new prime minister, Raja Ashraf, until Aug. 8, to respond to the court's demand that he write a letter reopening the corruption case. In response, the government hastily passed a law declaring high-ranking officials immune from contempt of court proceedings. But the court ruled that the law was unconstitutional because it eroded the court's authority. Last month, the Supreme Court made veiled threats that Ashraf could suffer the same fate as Gilani if he refuses to do so. For more than two years, the government has resisted judges' demands to reopen investigations into Zardari, arguing he enjoys immunity as head of state. The showdown could force elections before February 2013 when the government would become the first in Pakistan's history to complete an elected, full five-year mandate. The allegations against Zardari date back to the 1990s, when he and his wife, late premier Benazir Bhutto, are suspected of using Swiss bank accounts to launder $12 million allegedly paid in bribes by companies seeking customs inspection contracts. The Swiss shelved the cases in 2008 when Zardari became president and the government insists the president has full immunity as head of state. – Agencies