Queen Elizabeth II in Scotland for 'Holyrood week'
Stay tunned with 24 News HD Android App
It was the first public appearance for the 96-year-old monarch, who has been dogged by ill health, since her Platinum Jubilee celebrations ended on June 5.
She had previously held audiences at Windsor Castle with foreign diplomats and the Archbishop of Canterbury but had not been certain to travel to Edinburgh.
She took part in the symbolic Ceremony of the Keys, which sees her handed the keys of the city and welcomed to her "ancient and hereditary kingdom" of Scotland.
Tradition dictates that she hands them back to the lord provost -- the equivalent to the city's mayor -- when she leaves.
Other members of the royal family attending the event at the Palace of Holyroodhouse included her youngest son, Edward, and his wife Sophie.
The Earl and Countess of Wessex are known as the Earl and Countess of Forfar in Scotland.
The monarch's disgraced second son, Prince Andrew -- the Earl of Inverness north of the border -- is not involved.
He has been frozen out of royal duties due to public outrage at his links to the convicted sex offenders Jeffrey Epstein and Ghislaine Maxwell, and after he settled a US civil claim for sexual assault.
She spent an unscheduled night in hospital last October, forcing her to cancel a series of public engagements.
She has since complained of difficulties walking and standing, and has increasingly been seen using a stick for support.
On Tuesday, she is scheduled to attend an armed forces ceremony in the gardens of Holyrood.