Yousuf Reza Gilani's party is the largest in Pakistan's ruling coalition, and has said in the past it would have the numbers to elect a new premier if Gilani were ousted. A worst case scenario would be institutional deadlock coupled with social unrest, something that could raise the possibility of the army stepping in, as it has done three times in the country's past.
In its ruling, the Supreme Court ordered the country's election commission to formally dismiss Gilani and said he hadn't legally been the prime minister since April 26, when the court convicted him for contempt for refusing to open a corruption probe against his boss, President Asif Ali Zardari.
Gilani has been refusing to step down, saying he has done nothing wrong and accusing the Supreme Court's chief justice of having a vendetta against him and his party.
The Supreme Court ruling came in response to petitions filed against Gilani by the opposition for not standing down after that contempt conviction.
Gilani's Pakistan People's Party was meeting in an emergency session to discuss its response to the ruling.
Fawad Chaudhry, an adviser to the prime minister, said Gilani would continue working as premier and any final decision about his fate would be taken by the parliament. He didn't elaborate.