A Pakistan court overturned ex-prime minister Imran Khan's conviction on illegal marriage charges on Saturday, though he remains jailed after fresh charges were swiftly brought against him.
Khan was slapped with a trio of convictions in the days before February elections -- cases he says were orchestrated to prevent his return to power.
Those cases have now all been at least partially rolled back on appeal, with a treason conviction carrying a decade jail term overturned in April, and a 14-year graft sentence suspended in June, though the conviction still stands.
Khan and his wife Bushra Bibi had also been sentenced to seven years for allegedly marrying too soon after her divorce, in a breach of Islamic law.
But an Islamabad judge announced Saturday that the couple's appeals were accepted.
Khan remains locked up, though, with his Pakistan Tehreek-e-Insaf (PTI) party saying a court in eastern Lahore had approved his arrest over three cases alleging he incited riots in May 2023.
Spokesman Ahmed Janjua said it was "yet another gimmick to keep the illegal imprisonment prolonged".
Late Saturday, PTI said Khan and Bibi had also been arrested on a separate graft case.
Earlier this month a UN panel of experts found Khan's detention "had no legal basis and appears to have been intended to disqualify him from running for political office".
The "prosecution was not grounded in law and was reportedly instrumentalised for a political purpose," it said, calling for his immediate release after nearly a year in jail.
Khan served as prime minister from 2018 to 2022, when he was ousted after falling out with the military establishment, which wields huge influence over civilian politics.
In opposition he waged a campaign of defiance against the generals, who directly ruled Pakistan for decades of its history, even accusing them of being behind an assassination attempt that wounded him.
But the former cricket star's comeback was hobbled by scores of legal cases, which analysts say were likely brought at the behest of the military establishment.
Khan was first briefly arrested in May 2023, sparking nationwide unrest from PTI supporters, some of which targeted military facilities.
The government and military cited the attacks as justification for a sweeping crackdown on PTI, which saw its senior leadership decimated by arrests and defections.
PTI candidates were forced to stand as independents in the February 8 elections, which had been repeatedly delayed amid political chaos.
Khan's arrest and conviction for graft in August 2023 meant he was barred from standing for office himself, confined to a cell in Adiala Jail south of Islamabad.
Despite the setbacks, candidates loyal to PTI secured more seats than any other party.
Nonetheless they were blocked from power by a broad coalition of military-backed rival parties, amid widespread allegations of vote-tampering.
Gallup Pakistan analyst Bilal Gilani said the rolling back of the cases against Khan now could suggest the establishment was softening its stance in the wake of the election -- or that the courts were defying their attempts to keep him confined.
"It is an important judgement, because essentially now there are a limited number of cases left," he told AFP.
"Immediate release is quite impossible, but... the chances of release are getting clearer by the day," he added.