The Islamic Caliphate of Córdoba disintegrated into a number of regional principalities in 1031 after shifting balances of power and a lengthy civil war following the death of al-Halam II in 976. The caliphate was originally established as the Emirate of Córdoba by Abd-ar-Rahman I, who was a junior member of the deposed Ummayad Caliphate based in Damascus. He successfully conquered and united the rest of the Muslim lands in al-Andalus, whilst frequently coming under attack from forces of the newly established Abbasid Caliphate. Abd-ar-Rahman III declared himself caliph in 929, thereby establishing the Emirate of Córdoba as a caliphate, and oversaw its greatest period of power as it held off Abbasid attempts to take Morocco and conquests by Christians in the north. The caliphate had a comparatively large Jewish population who lived reasonably harmoniously within its Islamic society, although Jews and especially Christians enjoyed fewer rights that Muslims.