A DEEPFAKE video of John Swinney speaking in the Holyrood parliament has gone viral on social media.

The clip, which was apparently manipulated with artificial intelligence (AI) to replicate Swinney’s voice, appears at first to be of the new First Minister speaking to MSPs in a live Sky News broadcast.

AI deepfake videos like this one use “deep learning” to convincingly replicate a person’s appearance and voice.

The fake video sees the new SNP leader say: “Presiding Officer, I would like to thank Nicola Sturgeon for making sure I got re-elected to First Minister.

“I promise we will continue to f*** this country right up for the foreseeable future. We will also make sure that every school in Scotland receives bananas and nutella every day.

“I would also like to thank my predecessor Humza useless. I know he will be upset another white man is in charge now, but I would like to reassure him that is not the case.

“To make it clear, I am not a white man. I now identify as a black Muslim woman and will be the first female first minister for Gaza. Inshallah.”

At this point, the video cuts to Nicola Sturgeon sitting on the backbenches and mimics her mocking Swinney.

READ MORE: John Swinney sworn in as Scotland’s seventh First Minister

The fake video has been shared by right-wing social media accounts with large followings and been viewed more than 300,000 times.

The ultra-Unionist fringe group The Majority shared the video, as did GB News contributor Lee Harris, and Spectator columnist Gareth Roberts.

Last week, Professor Wendy Hall, who co-chaired the UK Government’s 2017 AI review, said it is too late to prevent this year’s General Election from the risks of misinformation spread via AI.

The regius professor of computer science at the University of Southampton said: “The cat is out of the bag really, so we are going to have to, I think we need a lot of public awareness around this to make people – and I know that the media are thinking about this – to make people think about where have they got this information from, what is the provenance of this information.

“Because there is no time to change laws or bring in big technical fixes before these elections start happening now.”

In April, a survey found that more than half of IT professionals fear AI-generated deepfakes could affect the result of the General Election.

A survey of workers in the sector by BCS, The Chartered Institute for IT, found 65% said they are concerned an election result could be affected by misleading AI-generated content.