The Queen’s two youngest sons received her coffin as the hearse arrived at the Palace of Holyroodhouse in Edinburgh, following a journey from Balmoral on a route lined by crowds of thousands.
Wellwishers gathered and stood in silence beside country roads and on bridges and in village and city centres to watch the cortege go by during its six-hour journey.
Having left her “beloved” Balmoral estate, where she died peacefully on Thursday, the Queen arrived in the Scottish capital for one final time.
Crowds had been gathering all day, and when the procession reached the Palace of Holyroodhouse, the monarchy’s official residence in Scotland, they were 10 deep in places on the famous Royal Mile, which the Queen knew well.
Some mourners threw flowers into the road to show their respect, as the cortege made its way through the Scottish capital.
The coffin received a guard of honour by the King’s Bodyguard for Scotland (Royal Company of Archers) as it entered the palace.
The Duke of York, and the Duke and Duchess of Wessex, and around 50 members of palace staff had gathered in the courtyard.
Both the Queen’s daughter, the Princess Royal, and Sophie, the Countess of Wessex, gave deep curtseys as the coffin was carried into the palace. The guard then left via Queen’s Drive.
As the royal convoy had travelled along the Royal Mile, there was a ripple of gentle applause, but the crowd fell silent when it entered the palace forecourt.
Scotland’s political leaders assembled to pay their respects outside the Scottish parliament when the cortege passed by.
First minister Nicola Sturgeon, Scottish Tory leader Douglas Ross, Scottish Labour leader Anas Sarwar, Scottish Green co-leader Lorna Slater and Lib Dem leader Alex Cole-Hamilton stood on the pavement outside Holyrood as the hearse slowed.
The procession then increased its speed into the Palace of Holyroodhouse.
Earlier, the convoy, led by the hearse carrying the Queen’s coffin, had passed over the Queensferry Crossing.
It crossed the River Forth from Fife around six hours after leaving Balmoral.
Upriver from the original Forth road and rail crossings, the structure was officially opened by the Queen on September 4 2017, 53 years to the day after she opened the adjacent Forth Road Bridge.
The oak coffin, draped with the Royal Standard of Scotland with a wreath of Balmoral flowers on top, will remain at the Palace of Holyroodhouse overnight.
On Monday it will process along the Royal Mile in Edinburgh to St Giles’ Cathedral, where the Queen will lie at rest to allow the public to pay their respects.
The procession, which went from Balmoral, the Queen’s summer sanctuary in the Highlands, to Edinburgh, included the Princess Royal and her husband, Vice Admiral Sir Tim Laurence, who were in a limousine directly behind the hearse.
A single motorbike police outrider led the way as the hearse, followed by six vehicles, travelled at a stately pace through the Aberdeenshire countryside.
At one point, as the cortege travelled through Dundee, a lone long-stemmed flower could be seen on the hearse windscreen and in a rural part of the route farmers paid homage to the Queen with tractors lined up in a field.
Justin Welby, the Archbishop of Canterbury, said he sympathised with those reminded of the death of a loved one in his Sunday sermon at Canterbury Cathedral.
He said: “Many people will be navigating their way around the raw and ragged edges of grief today.
“All because of the Queen. But many families as well will have lost loved ones or been reminded of the loss of loved ones this week.
“Their grief may well feel all the more painful during this time of national and international mourning for loss is overwhelming to the person bereaved.”
Ms Sturgeon paid tribute to the Queen, writing on Twitter: “A sad and poignant moment as Her Majesty The Queen leaves her beloved Balmoral for the final time.
“Today, as she makes her journey to Edinburgh, Scotland will pay tribute to an extraordinary woman.”