Al-Hakam II
The caliphate enjoyed increased prosperity during the 10th century. Abd ar-Rahman III united al-Andalus and brought the Christian kingdoms of the north under control by force and through diplomacy. Abd ar-Rahman III stopped the Fatimid advance into Morocco and al-Andalus in order to prevent a future invasion. The plan for a Fatimid invasion was thwarted when Abd ar-Rahman III secured Melilla in 927, Ceuta in 931, and Tangier in 951. This period of prosperity was marked by increasing diplomatic relations with Berber tribes in North Africa, Christian kings from the north, and with France, Germany and Constantinople. The caliphate became very profitable during the reign of Abd ar-Rahman III, by increasing the public revenue to 6,245,000 dinars from Abd ar-Rahman II. The profits made during this time were divided into three parts: the payment of the salaries and maintenance of the army, the preservation of public buildings, and the needs of the caliph. The death of Abd ar-Rahman III led to the rise of his 46-year-old son, Al-Hakam II, in 961. Al-Hakam II continued his father's policy toward Christian kings and North African rebels. Al-Hakam's reliance on his advisers was greater than his father's because the previous prosperity under Abd ar-Rahman III allowed al-Hakam II to let the caliphate run by itself. This style of rulership suited al-Hakam II since he was more interested in his scholarly and intellectual pursuits than ruling the caliphate. The caliphate was at its intellectual and scholarly peak under al-Hakam II.