Ibn Marwan
Ibn Marwân , was a Muladi Sufi whose family had come from northern Portugal and settled near Mérida.
In 868, leading a host of Muladis and Mozarabs, he rebelled against Emir Muhammad I of Córdoba and after a heroic resistance he got honourable surrendering terms from the Emir and was given Badajoz, which he started to fortify.
Knowing of an incoming attack by the Emirate forces, he fled northwards settling in the castle of Karkar. Afterwards, at Ibn Marwân's request, king Alfonso III of León sent him auxiliary troops and the combined army defeated the Emirate forces. Returning to Badajoz, now a well-fortified city, he established his rule throughout the whole of the Al'Garb Al'Andalus.
Together with his ally Sāʿḍūn al-Ṣurunbāqī, the other important Muladi rebel leader in Western al-Andalus, Ibn Marwan expelled the Banu Dānis from Coimbra. Between 876 and 877 he also erected the Castle of Marvão, in Portugal, a place already known in the 10th century as Amaia de Ibn Maruán or Fortaleza de Amaia.
His dynasty lasted until 930.