Holyrood Abbey was founded by King David I in 1128, and settled by canons of the Augustinian order. The monastery was established primarily to serve the royal castle of Edinburgh. Located at the bottom of the Royal Mile in Edinburgh, at the opposite end to Edinburgh Castle, Holyrood Palace has served as the principal residence of the Kings and Queens of Scots since the 16th century, and is a setting for state occasions and official entertaining.