The first royal palace was built on the site in the eleventh century, and Westminster was the primary residence of the Kings of England until a fire destroyed much of the complex in 1512. After that, it served as the home of the Parliament of England, which had been meeting there since the thirteenth century, and also as the seat of the Royal Courts of Justice, based in and around Westminster Hall. In 1834, an even greater fire ravaged the heavily rebuilt Houses of Parliament, and the only medieval structures of significance to survive were Westminster Hall, the Cloisters of St Stephen's, the Chapel of St Mary Undercroft, and the Jewel Tower.