First Minister Humza Yousaf revealed that Professor Jason Leitch is to leave his role as National Clinical Director at the end of April.

The announcement, just after 4pm today, came rather out of the blue and without a successor in place to take over from him in the role in six weeks or so.

Unusually for a backroom senior government official Mr Leitch became a prominent figure in Scotland.

After the Covid pandemic struck Scotland in March 2020, he appeared regularly alongside former First Minister Nicola Sturgeon in her daily Covid updates to the media and to many he came across as a reassuring and sympathetic voice during dark times.

Much in demand by broadcasters he appeared on radio and television almost every day at the height of the pandemic and seemed able to convey complex scientific information about the virus in an easy-to-understand way.

However, the public were left with a different impression of Professor Leitch as the UK Covid inquiry came to Edinburgh.

The inquiry was shown messages from a group in which Professor Leitch appeared to joke about deleting WhatsApp messages sent during the pandemic.

He told colleagues "WhatsApp deletion is a pre-bed ritual". 

The civil servant later admitted he had deleted all his WhatsApp messages during the pandemic.

Read more: Jason Leitch quits as Scotland's National Clinical Director

But messages obtained by the inquiry from Mr Yousaf appeared to show Professor Leitch giving advice to Mr Yousaf about how to get round rules on wearing a face covering as he prepared to attend a dinner in November 2021.

Mr Yousaf had said he knew he did not have to wear a mask when seated but did not know the rules when "standing talking to folk", despite being health secretary. Prof Leitch replied: "Officially yes but literally no one does. Have a drink in your hands at ALL times. Then you're exempt. So if someone comes over and you stand, lift your drink."

In his evidence to the inquiry Prof Leitch admitted he had always "presumed" there would be a public inquiry and Ms Sturgeon had announced her intention to hold a separate Scottish inquiry in May 2020.

However, in his written submission, he said: "Except for direct messages from my Twitter account, I have not retained any one-to-one informal communications in relation to the management of the pandemic in Scotland."

Appearing at the inquiry Prof Leitch said his "pre-bed ritual" message had been "a flippant exaggeration "and he did not "daily delete my WhatsApps". 

A spokesman for Mr Yousaf said the exchange over the face mask rules was simply the then health secretary seeking specific, up-to-date guidance from a senior adviser to ensure he was complying with the Covid rules.

Speaking outside the inquiry's Edinburgh International Conference Centre venue, Caroleanne Stewart, of Scottish Covid Bereaved, said at the time Prof Leitch had been "caught out" and the disclosures had been "heartbreaking".

Ms Stewart, whose brother died from Covid in 2020, said: "I trusted them, I felt him and Nicola Sturgeon were honest and trying to be open ... to find out that was all just a facade, I don't understand how they can hold their head up high ... I don't understand how they are still in a job." 

At the end of January he faced pressure to stand down as Scotland’s National Clinical Director for mocking opposition politicians in private WhatsApp messages.

In the chat with Mr Yousaf, who was then health secretary, the civil servant accused Conservative MSP Edward Mountain of being “rude” and “harrumphing like a child”, described Labour MSP Daniel Johnson as a “smarta***” and said Labour leader Anas Sarwar was "struggling" with one of a "new girl" (Labour MSP Mercedes Villalba).

Mr Sarwar said at the time the official had shown “extremely unprofessional behaviour” and said it was proof the “rotten culture” of Scotland’s political leadership had permeated into the senior civil service.

The Scottish Conservatives described the official as a “cheerleader” for the SNP and called for him to “do the decent thing and resign or be sacked as national clinical director.”

Professor Leitch started working for the Scottish Government in 2007 and was appointed as National Clinical Director in the Health and Social Care Directorate in January 2015. 

Prior to his Government role he was an oral surgery Consultant in NHS Greater Glasgow and Clyde.