AAMIR QURESHI / AFP / Getty Images Pakistani Prime Minister Yousuf Raza Gilani waves upon his arrival at the Supreme Court for a hearing in Islamabad, Pakistan, April 26, 2012.

For anyone hoping to see a Pakistani civilian government complete a full five-year term without any interruption, this verdict was sorely disappointing. On Tuesday, Pakistan’s Supreme Court ruled that Yousaf Raza Gilani can no longer continue as Prime Minister, raising tensions between the government and the judiciary to their highest point and leaving the country vulnerable to a new phase of political instability.

In its unusually terse ruling, the Supreme Court instructed President Asif Ali Zardari to arrange a successor for Gilani. While there is little prospect of Zardari’s government falling, his ruling Pakistan People’s Party (PPP) has accepted that there is no Prime Minister at the moment, and, therefore, no cabinet. The PPP is currently in crisis talks with its political allies to decide on a new Prime Minister. The challenge for the ruling coalition will be to hold on to its numbers, achieve a consensus on a new premier and survive a vote of confidence expected in the coming days.

(READ: Pakistan’s Supreme Court vs. Everybody.)

The court’s ruling raises the pressure on an already weak, unpopular and faltering government. In recent days, the country has seen a rash of violent riots over power shortages. In some areas in Punjab, Pakistan’s wealthiest and most populous province, there is no electricity for up to 20 hours. The economy is in trouble. Because of the court’s ruling, a new budget may have to be hashed out and authorized by Gilani’s replacement. Relations with the U.S. languish at an all time low, with NATO supply routes to Afghanistan via Pakistan still closed. And Pakistan-based militancy remains a poorly checked menace. Until some measure of political stability is recovered, these and other challenges will remain neglected.

On the face of it, the Supreme Court was punishing Gilani for obstinately refusing to pursue corruption allegations against his boss, President Zardari. It repeatedly prodded the government to write a letter to Swiss authorities, urging them to reopen an old money laundering case involving Zardari. The government denies the charges, and argues that, as President, Zardari enjoys full immunity under the constitution. Gilani declined to follow the instructions, was convicted of contempt in April, and has now been unceremoniously tossed out of the Prime Minister’s residence, which he occupied longer than any of his predecessors.

But to many observers, the Supreme Court’s decision was controversial. It stood out as the latest in a series of interruptions of the democratic process by unelected and unaccountable institutions. “This isn’t really about the law,” says Farzana Shaikh, a Pakistan expert at London’s Royal Institute of International Affairs. “This is about politics, and this is a power play by the Supreme Court.” In the past, it was the army that would ritually intervene, either through discreet backstage maneuvers, or even direct military coups. “Now, it is the Supreme Court that has decided that it better represents the people of Pakistan than those they elect,” says Shaikh.

The court’s decision is also being scrutinized for its seemingly unchecked desire to eliminate Gilani. The Supreme Court, legal experts say, had other options. The judges could have reserved judgment on Gilani’s legitimacy and referred the matter to Pakistan’s Election Commission, where the government would have the option of appeal. They could have accepted the Speaker of Parliament’s decision to allow Gilani to remain in office after he was convicted. By taking the unusual step of dismissing Gilani on its own, the court seemed to suggest it was not prepared to countenance another outcome.

There is much speculation that the Supreme Court hastened to remove Gilani after the emergence of lurid corruption allegations involving Chief Justice Iftikhar Chaudhry’s son, Arsalan. A highly influential property billionaire, Malik Riaz Hussain, has stepped forward over recent days to allege that Arsalan Chaudhry has been “blackmailing” him to the tune of $3.7 million. As evidence, Hussain has furnished receipts purportedly showing that the property tycoon financed expensive trips to London and Montecarlo. In return, Hussain claims, he was told that several outstanding legal cases against him would be dropped.

Supporters of the Chief Justice deny his involvement and counter the charges by saying that Hussain – who has close connections to the government — had been attempting to suborn Chaudhry’s son, at the urging of Gilani’s allies. Whatever the truth of the matter, the scandal has tainted the judiciary. One of the sources of Chaudhry’s popularity was his image as a crusader against corruption. Now, questions are being raised about the judge’s involvement, complicity or knowledge of the flow of funds. With the risk of the scandal eroding his authority, critics wonder if Tuesday’s verdict carries an element of revenge.

(READ: On the road with Iftikhar Chaudhry, Pakistan’s controversial Chief Justice.)

As elections loom, the verdict could be a mixed blessing for the ruling PPP. The dismissal of its Prime Minister could taint the party and hurt its chances. At the same time, though, it may cast itself as a political victim of shadowy anti-democratic forces – something that could help rally the party’s base at the next elections (which have to take place before next March). The fact that Gilani comes from the politically crucial battleground of southern Punjab may help the party’s standing there. There is much talk that his successor may also come from the same region.

But whoever emerges as Pakistan’s next Prime Minister will face a formidable array of challenges: an assertive Supreme Court will demand they take action against their own boss; overweening generals will be keen to take advantage of a weaker replacement; a teetering economy which may need yet another IMF bailout; the summer of energy-related riots will rage on; the window for negotiations with the U.S. will narrow; the ruling coalition will become shakier; and then there’s also the little matter of Islamist militancy. Perhaps Gilani will express some relief that he’s no longer in charge.