Between 1580 and 1640, the Crown of Portugal was integrated to the Crown of Spain, so Casablanca and all other areas occupied by the Portuguese were under Spanish control, though maintaining an autonomous Portuguese administration. As Portugal broke ties with Spain in 1640, Casablanca came under fully Portuguese control once again. The Europeans eventually abandoned the area completely in 1755 following an earthquake which destroyed most of the town.