Her Majesty the Queen’s ties with Scotland were in her DNA, as she was descended directly from James VI of Scotland through her father King George VI.
Meanwhile, on her mother’s side, she could trace her ancestry through generations of Scottish nobility back to the 14th century and Sir John Lyon, Thane of Glamis, who married King Robert II’s daughter.
And Glamis Castle was the ancestral home of the Queen Mother, as well as being the birthplace of the Queen’s sister, Princess Margaret, who was the first royal baby to be born in Scotland since 1600.
During childhood and throughout her reign the Queen spent plenty of time in Scotland, using the ancient royal palace of Holyroodhouse when in residence in Edinburgh.
But she had particular affection for her beloved family home of Balmoral, in Aberdeenshire, which was created by Queen Victoria and Prince Albert as the royal family’s private retreat.
She was also said to be particularly fond of the the Royal Yacht Britannia which she launched at John Brown’s shipyard in Clydebank on April 16, 1953.
The boat was used for many trips around the world until it was decommisioned in 1997, later becoming a tourist attraction in Edinburgh’s Leith.
Here are 22 pictures of some of the Queen’s visits to Edinburgh through the years.
Read more:

. Queen Elizabeth II dances an eightsome reel at the Royal Company of Archers' Ball in the Assembly Rooms, Edinburgh
Queen Elizabeth II dances an eightsome reel at the Royal Company of Archers' Ball in the Assembly Rooms, Edinburgh, in 1966. Photo: Unknown

. Take me to the bridge
Her Majesty The Queen and Prince Philip visiting the viewing area of the Forth Road Bridge in 2014 to unveil a new plaque marking the 50th anniversary of her opening the bridge. Photo: PHIL WILKINSON

. New parliament
Queen Elizabeth II and Scottish First Minister Donald Dewar watch the parades from the Royal Dias after the opening of the Scottish Parliament in Edinburgh in July 1999. Photo: ROGER DONOVAN

. Red carpet
The Queen arrives at Edinburgh's ABC Cinema to see the film of the opening of the Forth Road Bridge in September 1964. Photo: Unknown

1. Take me to the bridge
Her Majesty The Queen and Prince Philip visiting the viewing area of the Forth Road Bridge in 2014 to unveil a new plaque marking the 50th anniversary of her opening the bridge. Photo: PHIL WILKINSON

2. New parliament
Queen Elizabeth II and Scottish First Minister Donald Dewar watch the parades from the Royal Dias after the opening of the Scottish Parliament in Edinburgh in July 1999. Photo: ROGER DONOVAN

3. Red carpet
The Queen arrives at Edinburgh's ABC Cinema to see the film of the opening of the Forth Road Bridge in September 1964. Photo: Unknown

4. Now open
Queen Elizabeth II shakes hands with Sheriff Lillie when she officially opened the Forth Road bridge in September 1964. Photo: Unknown