Al-Hakam II, the Caliph of Cordova in Al-Andalus, was very fond of books and learning. It is said that he amassed a vast library that contained at least 400,000 books, if not more.
The catalogue of the royal library "alone consisted of forty-four volumes. Under Al-Hakam II, this library was reported to have given employment to over 500 people. . . . Elsewhere in Muslim Spain there was a total of seventy libraries in the 10th century, several in Toledo. In addition to the royal library, these included libraries in universities in Cordova, Seville, Malaga, and Granada , among others, and in numerous mosques.
Private libraries flourished in Al-Andalus, and it was said that Cordova was the greatest book market in the western world in the 10th century" (Harris, History of Libraries in the Western World 4th ed  81).
By the 10th century, the city was a paradise for scholars, translators, philosophers, and intellectuals of all disciplines who flocked there in great numbers and made it Europe’s intellectual hub. Translation thrived during his reign as the Umayyad Caliph of Cordova, which he ruled from 961 to 976. He strongly encouraged the translation of ancient Latin and Greek texts into Arabic. For this project he commissioned a joint committee to copy, translate, and write books comprised not only of Muslims but also Mozarab Christians and Jews who compatibly worked in teams to preserve the human cultural, scientific, and intellectual legacy to be bequeathed to future generations.
By the end of his reign, the shelves of the Royal Library contained more than 400,000 volumes (some say 600,000 volumes) spanning disciplines as diverse as philosophy, religion, literature, science, mathematics, astronomy, meteorology, alchemy, geometry, architecture, medicine, and more.
What is even more staggering is that al-Hakam II allegedly read and commented in the margins of all the books in the Royal Library. This claim is probably hyperbolic, but it shows the extent to which Caliph al-Hakam II loved books. The Caliph’s love for books and reading ultimately made his city the center of learning for the world. S.P Scott writes in “The History of the Moorish Empire in Europe” that:
“There were knowledge and learning everywhere except in Catholic Europe. At a time when even kings could not read or write, a Moorish king had a private library of 600,000 books. At a time when 99 percent of the Christian people were wholly illiterate, the Moorish city of Cordova had 800 public schools, and there was not a village within the limits of the empire where the blessings of education could not be enjoyed by the children of the most indigent peasant . . . and it was difficult to encounter even a Moorish peasant who could not read and write.”
What promoted the spirit of research and knowledge-seeking in Cordova were the supportive measures taken by the Caliph al-Hakam II to bolster education and learning in his kingdom. Writers, translators, and book-makers were exempt from participation in wars and conquests. They were also given precious gifts in return for their work and provided with suitable working conditions. One day, he sent 1,000 Dinars of pure gold to Abi al-Faraj al-Asfahani (from the city of Esfahan in Persia) for a copy of his book entitled “Al-Aghani” (Chants). Other writers also benefited from al-Hakam’s generous gifts, such Abi Bakr al-Abhari al-Maliki, Mohamed Ibno Chaaban Ibno al-Kacim, Mohamed Ibn Youssef al-Warrak, and many others.
Moreover, al-Hakam II dispatched book hunters to Baghdad, Cairo, Damascus, Constantinople, Basra, and other knowledge centers in search of the rarest books. He preferred to stockpile books rather than arms, and books were the best gifts with which other kings could buy his friendship.
The Royal Library first occupied part of the royal palace, but with the increasing number of written and translated books, it was soon overflowing, and the library had to be moved to another location near the palace. The library consisted of different sections, the most important of which, besides the writing section, was the translation section. A number of polyglot translators worked here, especially those mastering Latin, Greek, and Arabic. Among those translators were Abdullah Sqalli, Muhamed Ennabati, Abu Othmane Al-Jazzar, Muhamed Ibn Said, Abderrahman Ibn Isaac, and a Jewish translator called Hasdai Ibn Shaprut.
The massive efforts undertaken by the Caliph al-Hakam II to promote education, learning, and science in Cordova contributed to the flourishing of the Arabic language which became the language of the learned. Scholars, researchers, and students from all over Europe headed to Cordova to learn this language which would provide them with ample learning opportunities. Later on, these Western researchers would translate the works of Muslim scholars during the seventh and eighth centuries, providing the foundation of modern scholarship. European philosophers would probably not have known Aristotelian philosophy had it not been translated, studied, analyzed, and commented on by Muslim philosophers such as Averroes, Avicenna, and Al-Farabi whose works exerted a great influence on Western philosophy for several centuries.
The Arabs, Berbers, Jews, and Christians of medieval Cordova gave stunning evidence that societies flourish when they embrace diversity and make room for difference, instead of seeing differences as a threat.