The Scottish Government brought in an outside legal firm to support officials and politicians appearing at the UK Covid Inquiry, The Herald can reveal.

Those receiving taxpayer-funded legal assistance included Professor Jason Leitch and Ken Thomson.

Both men were criticised during their appearance in front of Lady Hallett for telling colleagues to delete WhatsApp messages so they couldn’t be made public.

READ MORE: Inside the NHS: Why is it hard for ScotGov to admit NHS recovery failure?

Others given assistance by solicitors from Morton Fraser MacRoberts, included Chief Medical Officer, Professor Sir Gregor Smith. He spent 90 minutes with the legal team, as did former health secretary Jeane Freeman.

Dr Audrey MacDougall, who serves as the Scottish Government's Chief Social Researcher, also had a one-hour and 30 minute session with the firm’s representatives.

Mr Thomson, who was the director-general for strategy and external affairs, received the same amount of time.

However, Professor Leitch, Scotland’s National Clinical Director, was given two and a half hours with the lawyers.

Details of the time spent with Morton Fraser MacRoberts were released to The Herald through Freedom of Information (FOI).

It’s not known how much the sessions cost.

Others were assisted in-house by the Scottish Government Covid Inquiries Response Directorate and the Scottish Government Legal Directorate.

Evidence gathered by the UK Covid Inquiry revealed that Nicola Sturgeon, along with several other senior ministers and health officials, all regularly deleted their WhatsApp messages.

In a group chat, uncovered by the probe, Mr Thomson boasted to colleagues that “plausible deniability are my middle names”.

In one message to deputy chief medical officer Lesley Steedman, Mr Thomson said: “Just to remind you (seriously), this is discoverable under FOI. Know where the ‘clear chat’ button is…”.

Mr Thomson also used the phrase “this information you requested is not held centrally”, a phrase the Scottish Government regularly uses when refusing FOI requests.

The Herald: Ken Thomson

In another, he warned members of the group that its contents were "FOI-recoverable" and sent an emoji face with a mouth zipped shut.

Professor Leitch responded: "WhatsApp deletion is a pre-bed ritual."

READ MORE: Labour council leader urges Gove to bypass to SNP in tax row

During his evidence to the inquiry, he insisted the comment was "slightly flippant".

He added: "It's an exaggeration. I didn't daily delete my WhatsApp.

"My position is - as I have just described to you - that I tried to do today's work today, and if I could assure myself that that work had been managed and dealt with, then I deleted the informal messaging that had led to that moment.

"But this was a flippant exaggeration in an informal messaging group, and it wasn't done every day before I went to bed."

When Jamie Dawson KC, counsel to the inquiry, said the exchange suggested that those in the group were "keen to try to delete messages which may subsequently be recoverable in a freedom of information request," Professor Leitch refuted the suggestion.

He said: "That isn't my position."

The health official was also embroiled in a row after it emerged he gave advice to Huzma Yousaf on how to dodge strict government rules on wearing facemasks.

Another transcript shared with the inquiry showed Sir Gregor in conversation with Deputy chief medical officer, Professor Graham Ellis, where he said: "Delete at the end of every day..." to avoid FOI. 

In her evidence, Ms Freeman said it “never occurred” to her to delete WhatsApp messages from her phone.

Asked if she was aware of a government policy that messages should be periodically deleted, she said: “I wasn’t aware of that policy. That’s not to say I hadn’t been given that policy but in the pace of the pandemic there were some documents like that that I may not have paid as much attention to, rightly, as others. So I wasn’t aware of that policy and I didn’t delete WhatsApp messages.

“I am not the most technologically gifted member of the Scottish Government at that time. So, I searched as best I could – as best as understood it – and then provided to the inquiry everything that I found.”

READ MORE: Humza Yousaf asks Westminster for help on Scottish child poverty cut

Scottish Conservative chairman Craig Hoy told The Herald: “The idea that top SNP Government officials were effectively coached in how to give evidence to the Covid Inquiry will rightly infuriate those who lost loved ones during the pandemic.

“Coupled with the shameful orchestrated deletion of WhatsApp messages, it points to the lengths they went to cover their tracks and evade scrutiny.

“And that’s before we consider the public money expended on legal fees to the firm in question.”

Scottish Liberal Democrat leader Alex Cole-Hamilton said: "I hope that these sessions were purely about making sure witnesses understood the nature and gravity of the sessions they were to take part in.

“The Covid Inquiry should be about giving a full and transparent account of decisions made during the pandemic to provide answers for all those who sacrificed and lost so much.

“For me, the bigger concern is the widespread deletion of key evidence between Nicola Sturgeon and other key players.

"I was extremely disappointed by the quality of evidence provided to the inquiry by Nicola Sturgeon and others. There is a real risk that those who lost loved ones never get a full accounting of the decisions that left them bereft.”

A Scottish Government spokesperson said: “We have a responsibility to offer appropriate support to those asked to present their evidence to the UK Covid-19 Inquiry in relation to their role in the Scottish Government’s response to the pandemic. 

"This support was offered via the Scottish Government Legal Directorate or their outsourcing partners, in this instance Morton Fraser MacRoberts.”

It is not the first time, the Scottish Government has hired lawyers to work with civil service witnesses for an inquiry.

Around £55,000 was spent on help for officials appearing before MSPs probing the botched handling of harassment complaints against Alex Salmond.

Four of the six witnesses involved subsequently had to correct evidence given under oath despite the preparation.

The inquiry was investigating the Scottish Government’s bungled handling of sexual misconduct claims against Mr Salmond in 2018.

The former first minister had the probe set aside in a judicial review by showing it had been “tainted by apparent bias”, resulting in taxpayers having to pay £512,000 for his costs. 

The Alba leader was cleared of sexual assault charges in a separate criminal trial in 2020.

Last year, Mr Salmond lodged a Court of Session petition alleging misfeasance by civil servants.

The Scottish Government is being represented in the case by Morton Fraser MacRoberts.