The caliph-scholar who built a library empire (961-976)

Al-Hakam II was not the kind of ruler who built armies. He built libraries.
He came to power in 961 CE as the second Umayyad Caliph of Córdoba, inheriting a caliphate his father Abd al-Rahman III had consolidated through military force and political theatre. Al-Hakam's instinct ran in the opposite direction. Contemporary sources describe a man who annotated manuscripts personally, who corresponded with scholars across the Islamic world, and who tracked the publication of new works in Baghdad and Cairo the way a collector tracks auction catalogues.[1]
The library he assembled at Madīnat al-Zahrā, the vast palace-city 8 km west of Córdoba built by his father, grew to a scale that medieval chroniclers struggled to express in believable numbers. Ibn Sa'id of Toledo and Ibn Bashkuwāl both cite a figure of 400,000 volumes, catalogued across 44 inventories of 20 sheets each. Some accounts push the total to 600,000. Even at a sceptical reading, the collection dwarfed anything in contemporary Christian Europe, where a well-stocked monastery might hold a few hundred books.

500+

People employed by Al-Hakam II's library: copyists, translators, cataloguers, and scribes. A 10th-century European monastery considered itself well-stocked with 200 books. Córdoba employed more people to manage its collection than most monasteries owned volumes.
The institution employed over 500 people: copyists reproducing rare texts, translators rendering Greek and Latin works into Arabic, cataloguers maintaining the inventories, and scribes who annotated acquisitions on al-Hakam's instructions. When a new work by a known author appeared anywhere in the Islamic world at its golden age, the caliph's agents had standing orders to obtain a copy before it reached general circulation.
Al-Hakam also founded 27 free schools in Córdoba itself, paid for from the caliphal treasury. That detail distinguishes him from the purely extractive models of patronage common in the period. He was not simply accumulating prestige through books; he was diffusing knowledge through the city that was, at that moment, the largest in western Europe.

Lubna of Córdoba: the freed slave who ran the collection

The chief librarian of the greatest book collection in the medieval western world was a woman born into slavery.
Lubna of Córdoba was born at Madīnat al-Zahrā, in the palace complex itself, and grew up within the caliphal household. Somewhere in that environment (we do not know her precise teachers) she acquired mathematical and linguistic abilities exceptional enough to attract serious scholarly attention.[2] She could solve problems in algebra and geometry. She composed poetry. She worked in multiple languages, including Arabic and Latin.
Equestrian show at the Caballerizas Reales de Córdoba with Andalusian horses

Explore nearby · Monument

Caballerizas Reales de Córdoba

Philip II's 1568 Royal Stables, birthplace of the Andalusian horse. Evening show combining classical dressage, vaquera riding and flamenco. UNESCO heritage.

Al-Hakam II appointed her Katiba al-Kubra (chief secretary and librarian), a title that gave her authority over both the transcription of royal correspondence and the management of the manuscript collection. She was, by the standards of any century, one of the most educated people in western Europe.
Her practical role was extensive. She transcribed and annotated manuscripts for the collection, assessed acquisitions for quality and authenticity, and collaborated with the court physician Hasdai ibn Shaprut on acquisition expeditions. Ibn Shaprut ran a remarkable network of his own: a Jewish polymath who served as a diplomatic intermediary between the caliphate and Byzantine Constantinople, and who used his diplomatic access to identify texts unavailable through commercial channels. Lubna's partnership with him was a working arrangement between two people whose social categories (a freed slave woman, a Jewish physician) would have made them invisible in almost any other administration of the period.
She tutored palace children in mathematics and grammar. Medieval biographical dictionaries, which rarely record women at length, preserved her name with explicit respect. A street in modern Córdoba bears it. The biographical recognition she received from writers like Ibn Bashkuwāl (who died in 1183, two centuries after Lubna) suggests her reputation survived the purges and destruction that consumed the library she managed.

How books reached Córdoba from Baghdad to Constantinople

The library did not simply grow. It was built through a sophisticated acquisition architecture that stretched across the known world.
The intellectual infrastructure behind it inherited much from the House of Wisdom in Baghdad, the Abbasid translation project of the 8th and 9th centuries that had rendered Greek, Persian, and Indian knowledge into Arabic. By the time al-Hakam II came to power, Arabic was the primary vehicle for philosophy, medicine, astronomy, and mathematics across the Islamic world. Córdoba wanted all of it.
Cairo supplied the Fatimid libraries' philosophical and scientific holdings, particularly through the Dar al-Hikma complex, which operated on a similar model to the Umayyad collection. Constantinople provided Greek and classical texts through diplomatic channels: Byzantine emperors sent manuscripts as gifts alongside embassies, and al-Hakam's court returned the gesture. Medina, Kufa, and Basra were primary sources for Islamic jurisprudence and the theological sciences.[3]
The subjects covered were genuinely universal: medicine, astronomy, geometry, philosophy, poetry, history, theology, and what we would now call natural science. Arabic translations of Euclid, Archimedes, Hippocrates, and Ptolemy sat alongside commentaries on the Quran and anthologies of Abbasid poetry. Works by Aristotle that had no Latin equivalent were available in Córdoba's stacks a century before the Latin translation movement began; Averroes would later be needed to put them back into accessible Arabic for a new generation.
The remnants of Madīnat al-Zahrā's grand halls where Al-Hakam II's legendary 400,000-manuscript library once stood, destroyed during the Fitna civil war. Al-Hakam II library Córdoba.

The reception halls of Madīnat al-Zahrā, 8 km west of Córdoba: the physical setting of Al-Hakam II's library. Berber mercenaries sacked the palace complex between 1010 and 1013, completing what Almanzor's purges had begun.

The library also functioned as a translation workshop. Joint committees of Arab Muslim scholars and Iberian Mozarab Christians (Arab-speaking Christians of Iberia) worked on rendering Latin technical texts into Arabic. This collaborative structure, with scholar, translator, annotator, and copyist operating in sequence, was the production model that made 400,000 volumes conceivable. It was also the thing that made Córdoba not merely a recipient of knowledge but a producer and synthesiser of it.

Almanzor burns the philosophers (981-1002)

Al-Hakam II died in 976 CE, leaving an eleven-year-old heir, Hisham II, and a power vacuum that his chamberlain Al-Mansur, known to history as Almanzor, filled with unusual speed and thoroughness.
Almanzor was a military man and a political calculator. He was not, by temperament or conviction, interested in philosophy. To consolidate his position as regent and eventually de facto ruler, he needed the support of Córdoba's Malikite religious establishment, the faqihs who controlled juridical authority and public morality. Their objection to the caliphal library was doctrinal: the collection contained Greek philosophy, logic, geometry, and astronomy, disciplines the Malikite establishment viewed as corrosive to orthodox Islamic belief.
Almanzor ordered a systematic purge. Contemporary sources, including later chronicles that drew on eyewitness accounts, describe books burned in caliphal courtyards and others cast into palace wells and covered with earth and stones.[4] What the faqihs defined as dangerous was comprehensive: works by Archimedes, Euclid, and Greek logicians; philosophical treatises engaging the relationship between reason and revelation; astronomical texts employing Ptolemaic geometry. Poetry, history, and religious scholarship were largely spared.
Almanzor needed the faqihs more than he needed Euclid. The calculation was transparent.
The purge ran from roughly 981 CE, when Almanzor had fully displaced caliphal authority, through his military campaigns against Christian kingdoms in the north. He sacked Santiago de Compostela in 997 CE, reportedly bringing back its bells as war trophies. The religious politics of that campaign and the library purge were continuous: a ruler performing orthodox Islamic credentials on every available surface.
What the purge destroyed cannot be precisely enumerated, because the catalogues that would have let historians count the losses were themselves among the things destroyed. Historians Hugh Kennedy and Brian Catlos have both written about this destruction as a political act dressed in religious language. Almanzor needed the faqihs more than he needed Euclid. The calculation was transparent.

The Fitna: Madīnat al-Zahrā razed, the rest scattered (1009-1031)

If Almanzor's purge was deliberate destruction, the Fitna of al-Andalus was a different kind of catastrophe: chaos that consumed what remained.
The Fitna (Arabic: civil strife) began in 1009 CE with the assassination of Caliph Hisham II and the collapse of Umayyad authority. What followed was nearly a decade of competing claimants, shifting alliances, and imported mercenary forces. Between November 1010 and May 1013, Berber mercenary forces besieged Córdoba and systematically sacked Madīnat al-Zahrā. They burned the reception halls, smashed the water channels and bathhouses, pulled down the carved marble screens, and looted whatever the fires left.[5]
The palace complex that had housed the greatest library in the western world became a quarry. Córdobans spent the next century removing columns, capitals, and dressed stone for reuse in city buildings. By the medieval period, the site was so thoroughly buried and dismantled that it effectively vanished from geographic knowledge. It was rediscovered only in 1911, when a farmer's plough struck carved stonework near the Sierra de Córdoba.
What remained of the library after Almanzor's purge was either destroyed in the Fitna's fires or scattered as looters took portable objects of value. Manuscripts, if they survived at all, moved north into the taifa kingdoms that replaced Umayyad authority after 1031, west into North Africa, or into private collections whose subsequent histories are unknown. No coherent body of text identifiable as part of al-Hakam's collection has surfaced. The convivencia era that Córdoba represents ended not with a single catastrophe but with two successive ones: an intentional purge and an accidental dispersal.
The institutional continuity was gone. The taifa kingdoms that carved up al-Andalus after 1031 had courts and patrons and scholars, but none had the resources or the ambition to rebuild what al-Hakam had spent fifteen years assembling. Averroes, working in Córdoba and Seville a century later under the Almohads, worked without the library that would have been his most natural resource.

The 400,000 figure: what historians actually say, and why the loss still matters

The number 400,000 comes from medieval chronicles written in the 10th and 11th centuries. Ibn Sa'id of Toledo and Ibn Bashkuwāl are the primary sources. Neither was inventing: they were reporting what they had heard from people who had seen the catalogues or worked in the library. Whether the figure represents distinct titles, total volumes including copies, or an aggregation across al-Hakam's reign rather than a single moment in time cannot now be determined, because the catalogues themselves were destroyed.[6]
Timeline
  1. 936 CE

    Madīnat al-Zahrā founded

    Abd al-Rahman III begins construction of the palace-city 8 km west of Córdoba. Al-Hakam's library will later occupy its main complex.

  2. 961 CE

    Al-Hakam II becomes caliph

    Acquisition network activated: agents dispatched to Baghdad, Cairo, Damascus, Constantinople, Medina, and Basra.

  3. 961-976 CE

    Library peak

    Collection reaches 400,000 volumes (medieval sources). Lubna of Córdoba serves as chief librarian. 500+ staff employed.

  4. 976 CE

    Al-Hakam II dies

    Hisham II, age 11, inherits the caliphate. Almanzor begins his consolidation of power.

  5. 981-1002 CE

    Almanzor's purge

    Philosophy, geometry, and astronomy burned or discarded. The Malikite faqihs provide religious cover; Almanzor provides the orders.

  6. 1010-1013 CE

    Fitna: Madīnat al-Zahrā sacked

    Berber mercenaries burn and loot the palace complex. What remained of the library is destroyed or scattered.

  7. 1031 CE

    Caliphate dissolved

    Al-Andalus fragments into taifa kingdoms. The institutional capacity to reconstruct the collection is gone.

Historians who have examined the evidence in detail, including Hugh Kennedy (Muslim Spain and Portugal, 1996), Brian Catlos (Kingdoms of Faith, 2018), and Jonathan Bloom (Paper Before Print, 2001), take a cautious position: the collection was demonstrably immense, the 400,000 figure cannot be verified, and that uncertainty does not diminish the scale of what was lost. Kennedy specifically notes that medieval scribal convention tended toward round numbers of prestigious magnitude, and that 400,000 was exactly the kind of number a chronicler would reach for to express something beyond normal accounting.
For comparison: the House of Wisdom in Baghdad, the most celebrated intellectual institution in early Islamic history, is estimated at between 10,000 and 100,000 volumes (itself a heavily debated range). The Fatimid library in Cairo at its peak was comparable to Córdoba's. Both were also partially or wholly destroyed: the House of Wisdom in the Mongol sack of 1258, the Fatimid libraries dispersed in the 1060s during a political crisis. The 10th century was not kind to large book collections.
What the debate misses, on both sides: precise arithmetic is the wrong frame. Even at conservative estimates (say 50,000 distinct titles), al-Hakam's collection contained works that have no surviving manuscript anywhere in the world. The philosophical texts by Greek authors that Almanzor's faqihs burned were not duplicated in Western libraries; European scholarship would spend the next two centuries trying to recover fragments of what Córdoba had owned complete. Maimonides, working in 12th-century Córdoba with access to Arabic-language Greek philosophy, was working at the downstream end of a transmission chain that al-Hakam II had actively maintained. After 1009, that chain was cut.
The loss matters not as a cultural monument to Islamic civilization (that framing is the tourist-brochure version) but as a specific, countable gap in the history of knowledge. Texts that existed in Córdoba in 975 CE and have no surviving copies elsewhere are simply gone. What al-Hakam built and Almanzor burned was not a symbol. It was the books themselves.