After the defeat of king Roderic at the Battle of Guadalete in 711 or 712, Theudimer resisted the invading Arabs and Berbers, but he was eventually defeated in pitched battle and made peace with the Muslim emir Abd al-Aziz ibn Musa.