Elgin Cathedral is a historic ruin in Elgin, Moray, north-east Scotland. The cathedral—dedicated to the Holy Trinity—was established in 1224 on land granted by King Alexander II outside the burgh of Elgin and close to the River Lossie. It replaced the cathedral at Spynie, 3 kilometres (1.9 mi) to the north, that was served by a small chapter of eight clerics. The new and bigger cathedral was staffed with 18 canons in 1226 and then increased to 23 by 1242. After a damaging fire in 1270, a rebuilding programme greatly enlarged the building. It was unaffected by the Wars of Scottish Independence but again suffered extensive fire damage in 1390 following an attack by Robert III's brother Alexander Stewart, Earl of Buchan, also known as the Wolf of Badenoch. In 1402 the cathedral precinct again suffered an incendiary attack by the followers of the Lord of the Isles. The number of clerics required to staff the cathedral continued to grow, as did the number of craftsmen needed to maintain the buildings and surrounds.