Founded in AD 955 by the Córdoba caliph Abd ar-Rahman III, Almería quickly became the largest and richest port in Moorish Spain and the headquarters of the Umayyad fleet. Its streets thronged with merchants from Egypt, Syria, France and Italy, who came to buy silk, glass, marble and glazed ceramics in Al-Andalus. It eventually lost its trading supremacy during a Christian occupation from 1147 to 1157 but it remained a significant Moorish city until conquered by the Catholic Monarchs in 1489. It subsequently went into rapid decline – a 1658 census counted only 500 inhabitants – due to devastating earthquakes, the expulsion of Andalucía's Muslim population and attacks by Barbary pirates. In the late 20th century its fortunes took a turn for the better as agriculture and tourism flourished in the surrounding region.