Pakistan's Supreme Court on Friday toppled Prime Minister Nawaz Sharif, who resigned after the court ruled he was unfit to hold office and ordered a criminal investigation into his family over corruption allegations.
Sharif's ruling Pakistan Muslim League-Nawaz (PML-N) party, which has a majority in parliament, is expected to name a new prime minister to hold office until elections due next year.
In a surprise move, the court also dismissed Finance Minister Ishaq Dar, one of Sharif's closest allies, who has been credited with steering the economy to its fastest pace of growth in a decade.
The disqualifications plunge Pakistan into another bout of political turmoil after a period of relative stability, which coincided with improving security in the nuclear-armed nation.
The ouster of Sharif, who served as premier on three separate occasions, also raises questions about Pakistan's fragile democracy as no prime minister has completed a full term in power since independence from British colonial rule in 1947.
The Supreme Court ruled unanimously that Sharif should be disqualified after an investigative panel alleged his family could not account for its vast wealth.
"He is no more eligible to be an honest member of the parliament, and he ceases to be holding the office of prime minister," Judge Ejaz Afzal Khan said in court.
Prior to the decision, several cabinet ministers, including Sharif's closest allies, said the ruling party would respect the Supreme Court's verdict.
"Go, Nawaz, Go," shouted supporters of the PTI opposition party who had gathered outside the court and jeered politicians from Sharif's party.
Sharif's supporters echoed the prime minister's previous declarations of a conspiracy.
"Those who are happy and dancing will cry tomorrow," said Abid Sher Ali, a junior minister. "They have stabbed democracy in the back."
Analysts have warned that another bout of political turmoil would spook foreign investors, who are already reticent to invest in Pakistan, deterred by security fears and a tough business climate.
Pakistan's benchmark stock index, which was one of the world's best performing in 2016, has recorded major outflows during the two-month investigation into Sharif. The currency, which is part of a managed float, has largely been stable.
Sharif, 67, has always denied any wrongdoing and has dismissed the investigation into him as biased and inaccurate.
"This is not accountability, it is revenge," tweeted Railways Minister Khawaja Saad Rafiq hours before the verdict. "In an effort dislodge us, the democratic system has been made a target."
Sharif's two previous stints in power were also cut short, including by a military coup in 1999, but he returned from exile to win a resounding victory in general elections in 2013.
Opposition politicians rejoiced, vowing to bring an end to Sharif's dynasty.
"Today the people of Pakistan got real justice, a new chapter has begun," Jehangir Khan Tareen, a member of the opposition PTI, said outside the court.
Sharif's ouster will be seen as a major victory for PTI leader Imran Khan, a cricketer-turned-politician who led street protests to demand an investigation into Sharif.
Khan pounced on the leaking of the "Panama Papers", which revealed Sharif's family had bought posh London apartments through offshore companies.
The Supreme Court ruled in April there was insufficient evidence to remove Sharif from office - by a 2-3 verdict - but it ordered a probe by an investigative panel that included members of the military intelligence agencies.
The Joint Investigation Team (JIT) this month returned its findings in a 254-report that said Sharif's family assets do not match their earnings. The panel also accused his children, including daughter Maryam, of signing forged documents to obscure ownership of the London flats.
Analysts expect Sharif to push for one of his allies to form a government until elections are held next year, when his brother Shahbaz, who is the chief minister in Punjab province, may take over the party leadership.
But the Supreme Court ruling has not only imperiled the political career of Maryan, but endangers the entire dynasty.