Elgin Cathedral, a historic ruin in Elgin, Moray, northeast Scotland, was dedicated to the Holy Trinity. It was established in 1224 on land granted by King Alexander II and stood outside the burgh of Elgin, close to the River Lossie. It replaced the cathedral at Spynie located 3 kilometres (2 mi) to the north, which was served by a small chapter of eight clerics. By 1226, the new and developing cathedral was staffed with 18 canons, a number that increased to 23 by 1242. A damaging fire in 1270 led to significant enlargement. It remained unscathed during the Wars of Scottish Independence but suffered extensive fire damage in 1390 when attacked by Robert III's brother Alexander Stewart, Earl of Buchan, also known as the Wolf of Badenoch. In 1402, the cathedral precinct faced another incendiary attack by the Lord of the Isles followers.
As the cathedral grew, so did the number of clerics and craftsmen. Repairs following the fires of 1270 and 1390 resulted in the choir's doubling in length and the addition of outer aisles to both the nave and choir. While some parts of walls retain their full height, others are at foundation level, yet the overall cruciform shape is still discernible. A mostly intact octagonal chapter house dates from the major enlargement after the fire of 1270. The near intact gable wall above the double door entrance linking the west towers was rebuilt after the fire of 1390. It contains fragments of a large rose window with remnants of tracery work. The transepts and the south aisle of the choir contain recessed and chest tombs with effigies of bishops and knights. The now grass-covered floor bears large flat slabs marking early graves. The residences of the dignitaries, canons and chaplains within the chanonry were also destroyed during the fires of 1270, 1390 and 1402, forming part of the overall reconstruction process. Only the precentor's manse remains substantially intact, while two others have been incorporated into private buildings. Both west front towers, part of the initial construction, are mostly complete. A massive protective wall surrounded the cathedral precinct, but only two small sections have survived. Of the wall's four access gates, only the Pans Port remains.