On July 28, Pakistan’s Supreme Court disqualified the Pakistani prime minister, thereby preventing him from serving out his full term, which was scheduled to end next year.

Sharif has served as Pakistani premier two other times, and in both cases, he was forced out prematurely. In 1993, he lost his job after the Pakistani president—a largely ceremonial position today, but a powerful one back then—dissolved Sharif’s government. Six years later, he was overthrown in a military coup. This time around, Sharif was dismissed after a long investigation stemming from revelations in the Panama Papers that Sharif’s children harbored offshore assets.

And yet, it’s not the Panama Papers that sent Sharif packing. Rather, the Supreme Court cited Articles 62 and 63 of the Pakistani Constitution—clauses instituted by military dictator Zia ul-Haq in 1985. They stipulate that any lawmaker deemed dishonest or untruthful can be removed from power. In its ruling, the court declared that Sharif had failed to disclose his employment with a Dubai-based company owned by his son when submitting his paperwork to contest the 2013 elections, which propelled him into power for his third term.

In a nation as divided as Pakistan, reactions to the Supreme Court judgment have been predictably split. Supporters of the ruling Pakistan Muslim League-Nawaz (PML-N) party, as well as occupants of Pakistan’s small liberal sphere, have denounced the verdict as arbitrary and unfair. He was booted from power not because of corruption charges, they note, but rather for failing to declare $2,700 in monthly income from a side gig (income Sharif insists he never received). Surely, so the narrative goes, other Pakistani officials—both in government and the military—have committed far more egregious transgressions. So why have they not been held accountable? Some opponents of the Supreme Court decision believe the Supreme Court—perhaps with the tacit approval of the powerful Pakistani military—engaged in inappropriate judicial overreach.

However, many others—particularly members and supporters of the main opposition party, Pakistan Tehreek-i-Insaf (PTI), as well as anti-corruption proponents and common citizens around the country—take a very different view. This is democracy in action, they declare: An elected official held accountable for misdeeds and forced to pay the ultimate political price—a refreshing change from all the Pakistani leaders who have done very bad things and eluded justice. Many Pakistanis are convinced that Sharif and his family are corrupt, even if corruption isn’t the reason he was ousted.

In effect, the Supreme Court has delivered its verdict. But within the court of public opinion, there’s a major split as to whether the verdict represents selective justice or justice served.

There are two clear winners. One is the PTI. This party, led by cricketer-turned-politician Imran Khan, accused Sharif of vote rigging in the 2013 election and had called for his ouster practically from the day he took office. “Go Nawaz Go,” a ubiquitous rallying cry, has been the constant soundtrack for the party’s advocacy. The PTI’s core objective has been achieved, and with flying colors.

The other winner is the Pakistani military—an institution that has often sparred with Sharif. In recent years, it has taken issue with his relatively conciliatory position toward India, and with his desire to put Musharraf on trial for treason. The army may not have orchestrated Sharif’s ouster, but it certainly won’t shed any tears now that he’s gone. Additionally, with civilian officials caught up in transition matters for at least several weeks, the military should be able to consolidate its already-formidable influence in state affairs. And it could enjoy an added bonus: Sharif’s intended replacement, his brother Shahbaz, is believed to be the more pro-military sibling.

In short, the Pakistani military now finds itself in a familiar position—firmly ensconced in the catbird seat.

The good news? A smooth, peaceful transition of power is in order. The PML-N has already announced its plan: Shahid Khaqan Abbasi, the petroleum minister and a legislator with close ties to the Sharif family, will serve as interim prime minister while Shahbaz Sharif goes through the process of getting elected to parliament (in a parliamentary system like Pakistan’s, the premier must be a legislator). That process should be a formality, given the PML-N’s strong legislative majority. Once Sharif becomes a parliamentarian—likely within the next two months—he will formally take office and serve out the remainder of his brother’s term while the party prepares for national elections next year.