A former high-ranking official has been sentenced to 10 years in prison after authorities said he disclosed state secrets.

According to a post on X on Tuesday, Former Prime Minister of Pakistan Imran Khan was sentenced to 10 years in prison for allegedly disclosing state secrets. The verdict comes a few days ahead of the parliamentary elections.

In the same case, a close aide to Khan, former foreign minister Shah Mehmood Qureshi, was also sentenced to 10 years. A special court established under Pakistan’s Official Secrets Act convicted both Khan and Qureshi.

The case centers on allegations that Khan leaked the contents contained in a secret cable called “Cipher” sent by the country’s ambassador in Washington to his government in Islamabad.

Khan has denied the charge, claiming that the document contained evidence that his removal as prime minister was a plot carried out by his political opponents and the powerful military, with help from the US administration.

Khan was Pakistan’s prime minister from August 2018 to April 2022, when he lost a vote of confidence in the parliament. He has been in jail since August last year, facing trial in multiple cases.

Syed Zulfiqar Bukhari, a spokesperson for Khan’s Pakistan Tehreek-e-Insaf (PTI) party, claimed the party will challenge the court’s decision.

“This was pretty much a writing on the wall,” Bukhari said. “Our lawyers were not allowed to represent Imran Khan. They were not even allowed to cross-examine the witnesses. What was unfolding in the court was merely a charade and a sham.”

According to the New York Post, this is the former prime minister’s second conviction. In August, he was disqualified from contesting in the general election after receiving a three-year jail term in connection with a corruption case.

Despite being disqualified from the elections, Khan’s legal team hopes to get him out of jail. Although the charges are being challenged in a higher court, the outcome of the conviction remains uncertain.

Khan’s political opponent, Nawaz Sharif, said the verdict was not harsh enough.

“I think, based on his carelessness and crime-pertaining to important national interests, this is a very light sentence,” Sharif said.