Theodemir or Theudimer (died 743) was a Visigothic comes (count) prominent in the southeast of Carthaginensis (the region around Murcia) during the last decades of the Visigothic kingdom and for several years after the Moorish conquest. He ruled seven cities in southeastern Spain, mentioned in the Treaty of Orihuela that was preserved by the Andalusian historian Ibn Adarí in the thirteenth century:Orihuela, Valentila (possibly an equivalent for Valencia), Alicante, Mula, Bigastro, Eyya (probably Ojós), and Lorca.
Sometime probably during the joint reign of Egica and Wittiza, a Byzantine fleet raided the coasts of southern Iberia and was driven off by Theudimer. The dating of this event is disputed: it may have occurred as part of Leontios' expedition to relieve Carthage, under assault by the Arabs, in 697; perhaps later, around 702; or perhaps late in Wittiza's reign. What is almost universally accepted is that it was an isolated incident connected with other military activities (probably against the Arabs or Berbers) and not an attempt to reestablish the province of Spania, lost in the 620s. As E. A. Thompson states, "We know nothing whatever of the context of this strange event."
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. "The text of the treaty he signed has been preserved in at least three separate sources, including a fourteenth-century biographical dictionary, and is dated to 5 April 713 (4 Recheb 94 AH)." The treaty allowed that Christians who submitted to Muslim rule ("the patronage of God") would be spared their lives and allowed to continue living with their families according to their mores and practising their Catholic faith in their churches, but they were required to pay a tribute per capita and to turn over any enemies of the conquerors to the government. The tribute consisted of one dinar, four measures (or jugfuls) each of wheat, barley, grape juice, and vinegar, plus two of honey and oil; and half this for slaves. Theudimer retained his land and his local authority.