Complex sentence: An Iberian and Roman city in ancient times, in the Middle Ages it became the capital of an Islamic caliphate.
Split into simpler sentences: An Iberian and Roman city in ancient times. Also in the Middle Ages it was capital of an Islamic caliphate.