Pakistan's former prime minister Imran Khan leads a freedom march to pressure the government to announce new elections, in Lahore
Imran Khan served as the 22nd prime minister of Pakistan from August 2018 until April 2022. Reuters

Pakistan's former prime minister Imran Khan used AI to release a campaign speech from behind bars today.

The 71-year-old, who remained Pakistan's most popular politician as of March, was toppled in April 2022 by the country's powerful military establishment.

He was arrested in August and sentenced to three years in jail for illegally selling gifts from other heads of state. Despite being granted bail, he has been held in prison for allegedly leaking classified documents.

Khan claims the allegations have been trumped up to stop him from contesting general elections due in February.

The former Prime Minister didn't let his imprisonment stop him from making an appearance in his party's campaign for the upcoming elections, due to be held in February 2024.

His political party, Pakistan Tehreek-e-Insaf (PTI), streamed a five-hour "virtual powershow" – an online rally ending with a four-minute speech written by the jailed Khan but delivered by an AI voice replicating his. Within 12 hours, it had already racked up more than 1.5 million views on YouTube.

"My fellow Pakistanis, I would first like to praise the social media team for this historic attempt," the voice mimicking Khan said. "Maybe you all are wondering how I am doing in jail," the stilted voice adds. "Today, my determination for real freedom is very strong."

According to PTI, it was bookended with genuine video clips from the onetime cricket star's former speeches, but a caption appeared at intervals flagging it as the "AI voice of Imran Khan based on his notes".

PTI said Khan sent a shorthand script through lawyers that was fleshed out into his rhetorical style. The text was then dubbed into audio using a tool from the AI firm ElevenLabs, which boasts the ability to create a "voice clone" from existing speech samples.

"This was a no-brainer for us when Imran Khan is no longer there to actually meet at a political rally," said the US-based PTI social media chief Jibran Ilyas. "It was to get over the suppression."

The PTI was the first political party in Pakistan to widely harness the potential of social media, using apps to target younger audiences who carried them to power five years ago.

"We wanted to get in election mode," Ilyas told AFP. "No PTI political rally is complete without Imran Khan."

However, the event was also met with reduced internet speeds and limited access to social media platforms - disruptions that Pakistani authorities are believed to have instigated ahead of the rally - that have further stoked concerns about the fairness of the country's upcoming election.

The election commission has been accused of amending constituency borders to favour Khan's opponent, former Prime Minister Nawaz Sharif. Meanwhile, mention of Khan's name or image has been blacklisted in mainstream media in Pakistan, and thousands of Khan's allies and supporters have had their homes raided and been arrested.

State censors banned Khan from the airwaves earlier this year after his brief arrest in May sparked riots.

NetBlocks said social media was restricted for seven hours starting late on Sunday in an incident "consistent with previous instances of internet censorship" targeting Khan.

Since AI surged into the mainstream discourse with the release of ChatGPT in November 2022, the technology has developed at a frantic pace.

This has led some experts to express concern at the unregulated advancement of AI models and called for laws and guidelines to be introduced.

In the past month alone, voice clones made using the technology have become increasingly common.

YouTube has tested an artificial intelligence tool that allows users to imitate famous singers, in a limited trial.

The experimental feature, named 'Dream Track', enables users to create short songs using AI by defining parameters such as mood and lyrical content.

At his year-end conference in Moscow last week, Russian President Vladimir Putin was confronted by an AI-generated clone of himself, who questioned him on the use of body doubles and artificial intelligence.

After a moment of rare hesitation from Putin, he replied by saying that he prefers to be the one and only Russian President.

"I see you may resemble me and speak with my voice. But I have thought about it and decided that only one person must be like me and speak with my voice, and that will be me," he said.