Archaeologists have discovered traces of ancient remains at Edinburgh Castle during preparation work for the construction of a new visitor centre.
Ditches may have surrounded the castle area during the Iron Age
Experts said borehole samples revealed debris dating from before the Iron Age, more than 2,000 years ago.
Historic Scotland's Peter Yeoman said the finds were "truly invaluable" because they helped to explain the site's "lost history".
Edinburgh Castle is one of Scotland's top tourist attractions.
Mr Yeoman, a senior archaeologist with the castle's owners Historic Scotland, said that it was certain that the front of the area where the castle now stands was encircled by two massive ditches as long ago as the Iron Age.
Inside the ditches are layers of remains including pottery and food debris built up over several centuries.
Edinburgh Castle stands high above the city centre on top of an extinct volcanic plug.