A secret strategy is in place to help key public bodies plan for the Queen passing away in Scotland, the Herald on Sunday can reveal.

Operation Unicorn will involve the immediate suspension of business at the Scottish Parliament as the authorities prepare for a state funeral that will become a global event.

A Holyrood source said the Queen dying north of the border could result in hundreds of thousands of people from across the world flocking to Holyrood.

It has previously been reported that the UK strategy for handling the Queen’s death, Operation London Bridge, dates back to the 1960s.

The plan has been adapted since the turn of the century and it is believed meetings take place around three times a year that include government departments, the police and broadcasters.

However, an online minute of the Scottish Parliament’s Leadership Group (LG), a forum for senior Holyrood staff, revealed the existence of a parallel strategy.

The account of the meeting, which took place in June, stated: “LG received an update on planning for Operation Unicorn – the death of Her Majesty The Queen while in Scotland. The primary focus was on the impacts on staffing and the specific impacts depending on timing.”

The secret codename was first mentioned in the Parliament’s online papers in 2017 when LG agreed to set up a “resilience board” for “disruptive incidents”.

Parliament proposed that the “significant incidents” should include Holyrood's role in London Bridge and Unicorn, without specifying what the latter meant.

It is understood that if the Queen dies in Scotland - she spends around three months a year at Balmoral - the Parliament, the neighbouring Palace of Holyroodhouse, and St Giles’ Cathedral will be the main focal points.

If the Monarch dies when the Parliament is sitting, chamber and committee business will be suspended and the funeral will take place around ten days after her death.

It is believed that up to six parliamentary days could be lost, but there will be thirty six hours to prepare for a motion of condolence in the chamber.

One of the major challenges facing the Parliament is coping with the huge number of people who are expected to want to sign a condolence book at Holyrood.

If the Queen passes away in Scotland, her body will rest at Holyroodhouse, following which her coffin will be carried to the cathedral on the Royal Mile.

At this point, her body will be placed on the Royal Train at Waverley station for a journey down the east coast mainline.

Passing references have been made to Operation Unicorn in NHS board papers, but with no explanation for what it is.

Transport for Edinburgh (TfE), which manages the Capital’s bus and tram network, is expected to have an important role in the days after the Queen’s death.

According to a TfE report, the transport body was last year given delegated authority for the coordination of the Edinburgh council side of Unicorn and other sensitive operations.

It noted that TfE had secured “long term” resources for these tasks, including police and army personnel, as well as “pro bono” support from a firm called Inverroy Crisis Management.

A newspaper reported last year that civic leaders in Scotland had taken part in a summit on Operation London Bridge.

“It was a provost’s association meeting,” one participant was quoted saying. “We were getting briefed on a very sensitive issue that we can’t say anything about. We meet every so often.”

A Scottish Parliament spokesperson said: "The existence of plans for a future change of reign are a matter of public record."