The Edinburgh Castle, with more than thousand years of history, viewed from the Princes Street Gardens, a public park in the centre of Edinburgh, the capital of Scotland. The majestic volcanic rock, that dominates the city and forms the basis of the Edinburgh Castle, has given a refuge of the early inhabitants and the defensive position for the first settlements, dated back the 9th century BC. The Edinburgh Castle has been a royal residence since the reign of David I in the 12th century until the Union of the Crowns in 1603. From the 17th century it was a military base with large garrison and as one of the most important fortresses in the Kingdom of Scotland it was involved in many historical conflicts. From the 19th century Edinburgh Castle was recognised as a historic monument.