It is the monarch's first trip to Scotland for the annual Holyrood Week since the death of her husband, the Duke of Edinburgh.
The Ceremony of the Keys saw the monarch handed the keys of the city and welcomed to "your ancient and hereditary kingdom of Scotland" by Edinburgh Lord Provost Frank Ross.
She is symbolically offered the keys to the city by the Lord Provost and tradition dictates that the Queen then returns them, entrusting their safekeeping to Edinburgh's elected officials.
The Queen inspected the Guard of Honour on the forecourt of the Palace and met with local government key workers, speaking to them about their roles during the pandemic.
The Guard of Honour was provided by the Balaklava Company, The Argyll and Sutherland Highlanders, 5th Battalion The Royal Regiment of Scotland.
They were supported by the Pipes and Drums of The Black Watch, 3rd Battalion The Royal Regiment of Scotland, and the Band of The Royal Regiment of Scotland.
Later on Monday, the royals are due to meet groups of volunteers and emergency responders.
Early, the Queen and Prince William visited the Irn-Bru factory, where the Prince enjoyed a sip of Scotland’s favourite drink.
Reporting by PA