Former Pakistani prime minister Imran Khan has been sentenced to 10 years in jail in a case in which he was charged with leaking state secrets.
Khan, who was ousted by his opponents as PM in 2022, is already serving a three-year jail term after being convicted of corruption.
He has called all the charges against him politically motivated.
The conviction under the secrets act comes the week before general elections in which he is barred from standing.
The former international cricketer later urged the public to "take revenge for every injustice with your vote on February 8 while remaining peaceful" in a statement released on his X (formerly Twitter) account.
"Tell them that we are not sheep that can be driven with a stick," he continued.
Former foreign minister Shah Mahmood Qureshi - vice-chairman of Imran Khan's Pakistan Tehreek-e-Insaf (PTI) party - was also sentenced to 10 years in prison by the special court set up inside Adiala Jail in Rawalpindi, where both men are being held.
The so-called cipher case revolves around the alleged leaking of secret diplomatic correspondence sent by Pakistan's ambassador in Washington to Islamabad when Khan was prime minister.
It relates to his appearance at a rally in March 2022, a month before the former cricketer was ousted from power in a parliamentary vote of no confidence. Imran Khan appeared on stage, waving a piece of paper that he says showed a foreign conspiracy against him.
He said it detailed that "all will be forgiven if Imran Khan is removed from power". He didn't name the country - but was subsequently highly critical of the United States.
The prosecution said that the former PM's actions amounted to leaking a classified document and damaging diplomatic relations. The latter charge can lead to life imprisonment or even the death penalty.
Imran Khan has been held in Adiala jail for most of the time since his arrest in August. International media were not allowed to attend proceedings in the special court which have been going on over the last few months.
Local media reported that the judge had recently been told to expedite the trial. A PTI spokesman said it would challenge the court ruling and called it a mockery.
"We don't accept this illegal decision," Naeem Panjutha, a lawyer for the former PM who is fighting scores of other legal cases, posted on X (formerly Twitter).
Another Khan aide said his legal team had no opportunity to represent him or cross examine witnesses but he was confident an appeal would be upheld in the high court.
Hours after the verdict, four PTI workers were killed and five others injured in an explosion at a political rally in Balochistan province. Police said initial investigations pointed to an explosive device, but it is unclear who planted it.
The sentencing comes just ahead of the delayed 8 February vote - an election mired in allegations the PTI is not being given a fair chance to campaign.
The authorities deny carrying out a crackdown on the PTI, but many of its leaders are now behind bars or have defected, its candidates are having to stand as independents and many are on the run.
Police also rounded up thousands of its supporters after protests - at times violent - last May when Imran Khan was first taken into custody.
The party has also been stripped of its cricket bat symbol, essential in a country with low literacy rates to allow voters to choose where to mark their ballots.
Many are questioning the credibility of next Thursday's vote, given the extent to which Imran Khan - still one of Pakistan's most popular politicians - and his party have been sidelined.
The man tipped to win is three-time former PM Nawaz Sharif, who returned from self-imposed exile in the autumn. He's been a thorn in the side of the powerful military for much of his long career and was jailed for corruption ahead of the 2018 election that Imran Khan won.
Now the tables have turned. Nawaz Sharif's court cases have melted away, leading many to believe he is currently preferred by the establishment, while his rival - who used to be seen as close to the military - has fallen out of favour.