First Minister Nicola Sturgeon’s personal security has been beefed up in the wake of a torrent of online threats hurled at the country’s political leaders.

It is understood a police officer is now responsible for driving the SNP leader to events in an unmarked police car. Until now, the First Minister's security has been minimal and she has been driven around by government civilian drivers.

In March, the Sunday Herald revealed that Police Scotland was investigating a catalogue of online abuse aimed at Sturgeon.

The hate speech, based on hundreds of tweets, included threats of violence and sexualised insults.

One troll wrote: “A f**king hate Nicola Sturgeon, wish someone would shoot the daft jock b*****d”.

Another Twitter user wrote: “Nicola Sturgeon needs a kick up the c**t”.

Scottish Labour leader Kezia Dugdale and Tory counterpart Ruth Davidson have also been targeted online.

Sturgeon and her Ministers have until now been ferried about by pool drivers in the Government Car Service, but this newspaper has learned that security around the First Minister has been stepped up.

A police officer now takes the lead on driving duties and a second officer sometimes accompanies her on visits.

Stuart Crawford, a former military officer who is a security and defence consultant, said: “Every public figure, whether political or not, is at risk to a certain extent. It is a case of trying to make an informed judgement of how great that risk is.

“I have met Nicola on the train from Edinburgh to Glasgow and chatted to her, and that is one of the great things about the politics of the Scottish Parliament. You can walk down the Royal Mile and meet MSPs and Ministers, and engage with them.

“But you have always got the nutter scenario - the John Lennon scenario. So it seems to be sensible for her to have that police driver and escort, so long as it doesn’t divorce her from the public."

He added: “People who might be on the receiving end of some sort of physical threat have just got to be wise to it.”

The shift mirrors security changes when Alex Salmond was First Minister between 2007 and 2014.

His government driver doubled up as a body guard and a police officer was later drafted in to act as a personal security adviser.

John Buchan was based in the former First Minister's private office as a "security liaison officer” and was tasked with scoping out potential threats.

A Scottish Government spokesperson said: “We do not comment on the First Minister’s security arrangements.”