From 1009 CE, the Cordoban Caliphate fragmented into smaller statelets, or taifas, each ruled by an emir. In 1013, Marvão fell within the new taifa of Badajoz (1013-1094), the largest taifa of al-Andalus, which stretched across Extremadura and modern-day Portugal to Lisbon and the Atlantic coast. Initially ruled by a Slav, Sabur,[28] from the 1020s the taifa was ruled by the Aftasid dynasty, a Berber clan, with a notable emir being Muhammad ibn Abd Allah Al-Muzaffar[29] (1045-1068).