The Panama Papers scandal claimed a very big scalp on Friday as Pakistani Prime Minister Nawaz Sharif was forced to resign from office.

His downfall may be encouraging for anti-corruption crusaders, but it could also have troubling implications for regional stability.

Sharif, 68, was declared unfit for public office by Pakistan’s Supreme Court on Friday. He issued a public statement that he had “strong reservations” about the verdict, but stepped down from his office soon afterward, dissolving his Cabinet in the process. Several of his allies and family members still face “accountability court” investigations within the next few months.

Sharif’s Pakistan Muslim League-Nawaz (PML-N) party is said to be working on a legal strategy to appeal the Supreme Court decision, while according to CNN his opponents spent the afternoon passing out candy to celebrate his downfall. They feel entitled to celebrate because it took massive street demonstrations to pressure the Supreme Court to consider the Sharif case at all.

Dawn.com notes that Sharif does retain the power to nominate his immediate successor, and the PML-N has a large enough majority to all but guarantee his nominee’s confirmation. The next election is about a year away. Unfortunately for the fallen Prime Minister, the person he has long been grooming to take over his political empire was his daughter Maryam Nawaz, who is also implicated in the scandal. He may have to make do with his brother Shehbaz, who currently governs a province in Punjab.

Sharif was brought down by his failure to properly declare a sizable fortune during the 2013 election, which was managed by his children through offshore companies exposed by the Panama Papers revelations—a trove of customer data stolen from Panamanian law firm Mossack Fonseca and presented to the media. Mossack Fonseca specialized in setting up complex financial arrangements to conceal the wealth of leaders around the world.

The New York Times writes that as a lengthy investigation into Sharif family finances proceeded over the past year, they proved reluctant to “provide satisfactory documentation,” and even produced some documents that were deemed to be forgeries. There have been allegations that some of the money used by the Sharif children to purchase their secret London real estate holdings were skimmed from the public treasury.

Sharif has long been suspected of abusing his political power to enrich his family. In fact, the Supreme Court judgment ended his third term as Prime Minister, and he did not finish the first two either. Neither has any other Pakistani Prime Minister since 1947, as the BBC points out.

Sharif was forced out of office during his first term by suspicions of corruption, while he was deposed in a coup by former General Pervez Musharraf during his second administration. He was hit with a lengthy prison sentence for corruption after the coup, but Saudi Arabia sprang him from jail, provided him with a comfortable exile, and then sent him back to Pakistan for a political rematch with Musharraf in 2013, which his critics think he won by stuffing the ballot boxes.

Sharif’s supporters, prominently including his daughter Maryam, think the investigation that brought the prime minister down was a political hit job. “Another elected Prime Minister sent home, but only to see him return with greater force and support, and soonest, inshallah,” she tweeted on Friday.

Pakistani TV journalist Amber Rahim Shamsi told the New York Times it would be a mistake to count the Sharif family down for the count. “The Sharif political dynasty has somehow managed to survive Pakistan’s rough and bloody politics for over three and a half decades through wheeling and dealing. It is hard to imagine all the family falling like a pack of cards. Nawaz Sharif has a following and could cash in on political martyrdom to stage a comeback,” she said.

The success of that comeback attempt will be shaped by whether Sharif’s nemesis Imran Khan is able to develop lasting political strength, or if his influence will fade now that he has landed the great white whale he spent the last few years chasing. Sharif’s party is still powerful, and his aborted term as Prime Minister has been seen as reasonably successful.

Only last year, former cricket star Khan was the one seen as washed-up in Pakistani politics, dismissed as an obsessive who took his shot at the top man and missed. Some of his party’s supporters were angry at him for wasting time on street theater that had seemingly failed to dislodge Sharif’s grip on power.

The BBC’s analysis paints Sharif’s ouster as part of the perpetual struggle between military and civilian leadership in Pakistan, which a cynic might characterize as civilian prime ministers lasting until the military grows weary of them. In Sharif’s case, he has been making diplomatic overtures to Pakistan’s arch-enemy India that the military did not like.

Khan has been criticized for being too close to the military leadership’s world-view, including a distressingly soft stance toward the Taliban in Afghanistan and the Pakistani tribal areas. With the Taliban resurgent and making progress on destabilizing the Afghan government, analysts such as former U.N. Ambassador John Bolton worry that political instability in Islamabad could allow radical elements to increase their influence in nuclear-armed Pakistan.

Then again, based on the past sixty years of history, the truly world-shaking, game-changing political event in Pakistan would be a prime minister actually completing his term.