The Cathedral of St Andrew was built in 1158 and became the centre of the Medieval Catholic Church in Scotland as the seat of the Archdiocese of St Andrews and the Bishops and Archbishops of St Andrews. It fell into disuse and ruin after Catholic mass was outlawed during the 16th-century Scottish Reformation. It is currently a monument in the custody of Historic Environment Scotland. The ruins indicate that the building was approximately 119 m long, and is the largest church to have been built in Scotland.
The west end was blown down in a storm and rebuilt between 1272 and 1279. The cathedral was finally completed in 1318 and featured a central tower and six turrets; of these remain two at the east and one of the two at the western extremity, rising to a height of 30 metres. On the 5th of July it was consecrated in the presence of King Robert I, who, according to legend, rode up the aisle on his horse.
A fire partly destroyed the building in 1378; restoration and further embellishment were completed in 1440.
In June 1559 during the Reformation, a Protestant mob incited by the preaching of John Knox ransacked the cathedral; the interior of the building was destroyed. The cathedral fell into decline following the attack and became a source of building material for the town. By 1561 it had been abandoned and left to fall into ruin.
References:Visby Cathedral (also known as St. Mary’s Church) is the only survived medieval church in Visby. It was originally built for German merchants and inaugurated in 1225. Around the year 1350 the church was enlarged and converted into a basilica. The two-storey magazine was also added then above the nave as a warehouse for merchants.
Following the Reformation, the church was transformed into a parish church for the town of Visby. All other churches were abandoned. Shortly after the Reformation, in 1572, Gotland was made into its own Diocese, and the church designated its cathedral.
There is not much left of the original interior. The font is made of local red marble in the 13th century. The pulpit was made in Lübeck in 1684. There are 400 graves under the church floor.