The Christian king Jaime I the Conqueror conquered the city during the Mudéjar revolt of 1264–66. Despite an existing pact with the Muslims of the city that prevented the destruction of any mosque, Jaime I took the Great Mosque or Aljamía to consecrate it to the Virgin Mary; a custom he put in place when he conquered any settlement. However, it was not until the 14th century that construction of the cathedral would begin. In 1385 work on the foundations started and in 1388 the first stone was laid. Another six years passed until constructions upwards continued; the cathedral would be finished in October 1467. Nevertheless, the cathedral continued to evolve until the 18th century, demonstrating a variety of artistic styles.