As the royal household's representative in Edinburgh, the Lord Provost is granted a level of access to the monarch greater than anyone else in the city.
Dating back to the 14th century, it is a role rooted in tradition, pomp and circumstance and guarantees a meeting with the monarch every year.
Over centuries, Lord Lieutenants who have served the capital, of which there have been 256, have welcomed Kings and Queens to Edinburgh for Royal Week, a celebration of Scottish culture, community and achievements held each July.
READ MORE: Edinburgh councillors united in grief after Queen Elizabeth II dies
Shortly after their arrival at the forecourt of Holyroodhouse Palace, the Lord Provost presents the monarch with the keys to the city - an ancient tradition known as the Ceremony of the Keys.
The Provost says: "We, the Lord Provost and the members of the City of Edinburgh Council, welcome Your Majesty to the capital city of your Ancient and Hereditary Kingdom of Scotland and offer for your gracious acceptance the Keys of Your Majesty's good City of Edinburgh."
But the sovereign returns them "being perfectly convinced that they cannot be placed in better hands than those of the Lord Provost and Councillors of my good City of Edinburgh."
Over countless visits to Edinburgh during her 70-year reign, Queen Elizabeth handed the keys back to 20 separate Provosts.
Her last Ceremony of the Keys was held in June. But it was the first for the city's newest civic head Robert Aldridge, who is only a few months into the role.
Remembering the day, he said: "At the time we'd heard a whole lot of reports about how poor her mobility was and so on but when she arrived at Holyrood she got out of the car in a very lively way, she was really chatty."
Mr Aldridge recalled the Queen was "a bit frustrated" that the mobility issues meant she was unable to inspect the troops as is tradition.
"Prince Edward did the inspection but she watched him do it and I could see how frustrated she was," he said. "But she made it very easy to talk to her, she made my first time doing the Ceremony of the Keys as easy as easy as it possibly could be.
"And of course, she was absolutely professional and and word perfect with her response to me.
"In my brief contact with her, like everybody the first time you have to interact with the Queen your brain turns to mush no matter how much you have prepared.
"I did manage to fluff a little bit of my line in the Ceremony of the Keys and I just saw that wonderful smile on her face and that humorous glint in her eyes and it was quite encouraging."
He added news of Her Majesty's death yesterday came as "a bolt from the blue".
"I had just returned from an important civic function offering awards to the best kept war memorial and my phone had been in the boot of the civic car," he explained. "I had not had access to email and I returned early afternoon to quite devastating news on the TV."
Lesley Hinds, Lord Provost of Edinburgh from 2003-2007, said she crossed paths with the Queen "many times" during her time in office.
"I enjoyed discussing current and future issues for Edinburgh, our families, and as only the second woman to be the Lord Provost of Edinburgh, the role of women in our society," she added.
Ms Hinds, who was a city councillor for over 30 years and stood down at the local 2017 election, remembered meeting the late monarch for the first time at the official opening of Edinburgh International Conference Centre.
"My mum was an admirer of the Queen and was thrilled to come as my guest and to meet her," she said. "My Mum and Auntie were of the Queen’s generation and were always delighted to be invited to meet her.
"When my Mum passed away I found a photo album, which was full of photos of us both! My Auntie, a Leither, is the same age as the Queen, and will be particularly mourning her passing, like many of her generation.
"As Lord Provost of Edinburgh and Lord Lieutenant, I met the Queen on many occasions, including the Ceremony of the Keys several times during Royal Week. Even though she must have carried out this ceremony many, many times, it always felt like it was the first time.
"One of the best occasions, for me, was the official opening of the Scottish Parliament building at Holyrood. For me, as a strong supporter and campaigner for devolution, it was a moving day, celebrating along with with people from all walks of life a momentous occasion with the Queen.
“Like many in Edinburgh and Scotland I was saddened by the passing of Her Majesty the Queen.
"My thoughts are with the Queen’s family as they come to terms with their personal loss."
Mr Aldridge said Edinburgh will play "a very key role over the next few days" as the Queen's coffin arrives in the city for a procession to Giles' Cathedral.
"It will lie in rest in St Giles' for a couple of days and there will be an opportunity for some people to file past it and pay their respects," the Provost added.
"I will be meeting King Charles III when he arrives in Edinburgh, it's sort of quite awkward because it's a wonderful thing for him to be the new king and for us to celebrate that but at the same time under what terrible circumstances for it to happen in and a family grieving at the same time.
"It must be a terrible thing for him grieving for his mother and supporting the rest of his family but with all the responsibilities of being the new monarch so we do wish him every success in his reign but I think at the moment it's time for us to come to terms with the loss of his mother and out Queen - the only monarch almost all of us have ever known."
READ NEXT:
- Edinburgh city centre schools to shut for Queen's arrival in capital
- Changes to Edinburgh bin collections announced following Queen's death
- Edinburgh condolence book for Queen set-up as capital mourns monarch
- Edinburgh closures and cancellations following the death of Queen Elizabeth II
When Queen's body will arrive in Edinburgh from Balmoral as procession planned