In the grounds of the palace are the ruins of Holyrood Abbey.
According to legend King David I, son of Malcolm Canmore and St Margaret, was out hunting here one day in 1128, when he was charged by a huge stag and thrown from his horse. The stag then tried to gore him, and the king grabbed hold of its antlers to protect himself, only to find that he was instead holding a crucifix set between the horns. The stag then disappeared, leaving the crucifix in his hands. That night in a dream he was commanded to build a "house for Canons devoted to the Cross, and so he founded an Augustinian abbey of the Holy Rood (another word for Cross) on the site of his miraculous escape. The only surviving part of King David's Norman church is a doorway in the far southeastern corner. Most of the remains date from the early 13th century.
The abbey was, at its height, a building of great importance and splendour, and this is hinted at in the surviving parts of the west front. Much of it was destroyed, as were many of the county's finest ecclesiastical buildings, during the Reformation. During the reign of Charles I it was converted to the Chapel Royal and later to the Chapel of the Order of the Thistle, but it suffered severe damage once more, this time during the 1688 revolution. Some restoration work was attempted in the 18th century, but this only caused the roof to collapse in 1768, and since then the building has been left as a ruin. In the Royal Vault beneath the abbey are buried several Scottish Kings, including David II (son of Robert the Bruce), James II, James V and Lord Darnley, 'King Consort' to Mary, Queen of Scots.