 The town was later known as Wādī-al-Ḥajāra (), possibly meaning "Valley of Stones" (as in river gravel); in theory it may be a literal translation of the Iberian name "Arriaca".It has also been also proposed that "Ḥajāra" should not be understood as "stones/gravel", but in the sense of "castles" or "fortified rocks".Part of the of Al-Andalus, the city and its wider district was controlled by the Masmuda berber clan of the Banū Sālim who governed on behalf of the Umayyad rulers of Córdoba.