At the castle, Harry and Ms Markle joined Sergeant Dave Beveridge, district gunner, Royal Artillery, for the firing of the One o’Clock Gun.

They were given ear defenders before standing behind the gun, which dates back to 1861.

The couple also chatted to cadets and took in views across the city, before briefly waving to the crowds as they departed.

Image copyrightPAImage caption Prince Harry and Meghan Markle meet Sgt David Beveridge (right) before he fires the One o’clock gun at Edinburgh Castle Image copyrightPAImage caption Harry and Meghan before the One O’Clock gun was fired Image caption Harry and Meghan stood back and wore ear defenders as the One O’Clock Gun was fired

Harry and Ms Markle then visited social enterprise cafe, Social Bite, where they were again greeted by large crowds.

Many people waited in the cold for three hours for a glimpse of the pair.

Image copyrightPAImage caption Prince Harry and Meghan Markle during a visit to Social Bite in Edinburgh

Social Bite distributes 100,000 items of food and hot drinks to homeless people across Scotland each year, as well as employing staff who have experienced homelessness themselves.