The first building to be located at Linlithgow Palace was a tower house built by Edward I of England in 1302. Successive scottish kings added to this royal residence until it burnt down in 1424 along with the rest of the town of Linlithgow. In 1425 James I began the reconstruction of the residence and this was continued by Stuart Kings in the 15th and 16th centuries. This gateway was built in about 1535. The palace was abandoned as a royal residence after the Union of the Crowns in 1603 when the court of James VI transferred to London. Bonnie Prince Charlie stayed there briefly in 1745 before the troops of the Duke of Cumberland burnt it to a ruin. The palace is the birthplace of Mary Queen of Scots in 1542 and her father James V of Scotland in 1512. The Church of St. Michael was first consecrated in 1242 but there is documentary evidence that a church stood on this site in the 12th century. Like the palace, the church was destroyed by the fire of 1424 and so it was rebuilt between 1425 and 1531 and was one of the largest churches in Scotland prior to the reformation. The stone crown above the tower was removed for safety reasons in 1820 but in 1964 a new crown of laminated wood and aluminium was added.