The city is located on the banks of the Guadalquivir river, and its easy access to the mining resources of the Sierra Morena (coal, lead, zinc) satisfies the population's needs.
During the 10th century, it was the second richest city in the Muslim empire (after Bagdad), to which learned men from all Europe came to study during the 11th and 12th centuries
The city declined especially after Renaissance times. In the 18th century it was reduced to just 20,000 inhabitants. The population and economy started to increase only in the early 20th century.