Ibn Marwân (‘Abd al Rahmân Ibn Marwân ibn Yūnus, also known as Ibn al-Djillīqui or "Son of a Galician") (died ca. 889), 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 (now Carquere, near Lamego, Portugal). 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.
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.