In the 8th century, nearly all of the Iberian Peninsula was conquered (711–718) by largely Moorish Muslim armies from North Africa. These conquests were part of the expansion of the Umayyad Caliphate. Only a small area in the mountainous north-west of the peninsula managed to resist the initial invasion. Legend has it that Count Julian, the governor of Ceuta, invited the Muslims and opened to them the gates of the peninsula as revenge for the violation of his daughter, Florinda, by King Roderic.