Apparently it was a Phoenician colony, then Roman, then hot potato'd between Berbers, Vandals, caliphs, Portugal, and Spain. It has a long history of being controlled by Some Guy In Iberia™