Operation Unicorn is one of several plans drawn-up in the event of a senior royal passing away while north of the border. A specialist team comprising the Scottish Government, local authorities, the emergencies services, transport bodies and the armed forces meets twice a year to update and fine tune the arrangements.
It states that on hearing the news, parliamentary business would immediately be suspended to allow authorities to prepare for the Queen’s state funeral.
Business at Westminster and Holyrood are suspended for at least six parliamentary days. All major sporting events will be postponed, including cinch Premiership football matches in Scotland.
There is an anticipated influx of tourists and mourners to Scotland, and Edinburgh in particular, who have been encouraged to gather around the Scottish Parliament building, the Palace of Holyrood House and St Giles’ Cathedral.
The Monarch will be conveyed from Aberdeen to Edinburgh on the Royal Train, which was reportedly being prepared for the journey from Wolverhampton to Aberdeen then back south via the East Coast Main Line to Londin.
Members of the Armed Forces and the emergency services will form an honour guard every platform on the route.
As the train will be travelling well below normal speed, security will be ultra-tight with air, land and sea covered by the military. Temporary fire and police stations will be set up at the Palace of Holyroodhouse with a strong armed police presence, backed by the military.
In Edinburgh, the Queen’s body will lie in repose at Holyroodhouse, the official royal residence in Scotland, before her coffin is carried to St Giles’ Cathedral.
At the cathedral, Scotland’s senior civic leaders, dignitaries and members of the public will have the opportunity to pay their respects and sign a book of condolence.
The coffin would then be placed on the Royal Train at Waverley Station before travelling down the East Coast Mainline to London.
Operation Unicorn ends when her Majesty leaves Scotland for the last time, departing Edinburgh Waverley for St. Pancras Station, London.
Similar arrangements were made for the late Prince Philip, Duke of Edinburgh, under the title of Operation Forth Bridge.
Nationwide, Operation London Bridge has also already been launched.
It states that in the hours after the news breaks of the monarch’s death, known as ‘D-Day’, there will be a “call cascade” to inform the Prime Minister, former Prime Ministers, senior civil servants and the heads of Commonwealth countries, using the code phrase “London Bridge is down”, while the royal household issue an official notification to the public, posted on the gates of Buckingham Palace. Flags at Whitehall and on other public buildings across the UK were lowered to half-mast within minutes.
Books of condolence will be opened around the country, gun salutes will take place at saluting stations and a service of remembrance will be held at St Paul's Cathedral.
Different arrangements are in place depending on where the Queen passes, but ultimately her coffin will be taken to the the Throne Room at Buckingham Palace.
Five days after the Queen's death, the coffin will be moved to Westminster Hall and, after a service, lie in state for three days.
The state funeral will be held at Westminster Abbey ten days after the Queen's death, after which her body would be buried in a prepared tomb at King George VI Memorial Chapel in St George's Chapel, Windsor Castle, alongside Prince Philip.
The day of the funeral will be declared a Day of National Mourning, although not an official bank holiday, and a period of two minutes' silence will take place across the UK at midday.
Also underway is Operation Spring Tide, the plan for the Prince of Wales' ascension to the throne, starting the day after the Queen’s death when he will be proclaimed the new king by the Accession Council at St James's Palace.
That evening MPs would swear allegiance to the new monarch, followed by proclamations by the Scottish, Welsh and Northern Irish administrations the day after.
On the third day the new monarch would receive the motion of condolence at Westminster Hall in the morning and then depart for a tour of the United Kingdom, attending services in Edinburgh, Belfast and Cardiff before returning to London for his mother’s funeral.
It is understood that Charles and Camilla were flown by helicopter to Balmoral in to see his ‘dear mama’ one final time before she passed away.
A helicopter from the royal fleet was reported to have made a direct flight from Dumfries House in Ayrshire to Royal Deeside.
Throughout Operations Unicorn, London Bridge and Spring Tide, security across the UK will be at an unprecedented high.
Former counter-terror chief Nick Aldworth said police and security services will anticipate huge crowds of people flocking to mourn the loss of the monarch, with plans on an “enormous” scale set in motion.
The former counter-terrorism national co-ordinator, said the UK’s terrorism threat level is currently “substantial”, meaning an attack is “likely”.
Mr Aldworth said: “It’s probably the biggest operation that we’re likely to mount in the UK.”
Tens of thousands of people arriving to line routes on both sides of the Border ahead of any ceremonial event would create the “most demand on police and the security operation”.
Rooftop snipers will be in place with the coffin escorted by armed officers and a helicopter.
Security screening for knives and other weapons will be carried out in some areas.
Mr Aldworth said another “major consideration” is organising the armed protection for visiting foreign dignitaries.
Police Scotland is expected to send officers to assist.
“There are only so many armed protection officers in the UK,” said Mr Aldworth, warning that there are “certainly not enough in London.
“The whole operation will draw massively on resources from across the country.”