St Andrews Castle is a picturesque ruin located in the coastal Royal Burgh of St Andrews in Fife, Scotland. The castle sits on a rocky promontory overlooking a small beach called Castle Sands and the adjoining North Sea. There has been a castle standing at the site since the times of Bishop Roger (1189-1202), son of the Earl of Leicester. It housed the burgh’s wealthy and powerful bishops while St Andrews served as the ecclesiastical centre of Scotland during the years before the Protestant Reformation.
During the Wars of Scottish Independence, the castle was destroyed and rebuilt several times as it changed hands between the Scots and the English. Soon after the sack of Berwick in 1296 by Edward I of England, the castle was taken and made ready for the English king in 1303. In 1314, however, after the Scottish victory at Bannockburn, the castle was retaken and repaired by Bishop William Lamberton, Guardian of Scotland, a loyal supporter of King Robert the Bruce. The English had recaptured it again by the 1330s and reinforced its defences in 1336, but to no avail. Sir Andrew Moray, Regent of Scotland in the absence of David II, recaptured it after a siege lasting three weeks. Shortly after this, in 1336-1337, it was destroyed by the Scots to prevent the English from once again using it as a stronghold.