Ibn Ḥayyān said: When the Muslims first conquered Córdoba, they shared its great church with the city’s Christians, just as Abū ʿUbayda and Khālid had done with the non-Arab inhabitants of Damascus. One half they converted into a mosque, while the other half remained in the hands of the Byzantines. As Córdoba grew and successive Arab detachments settled there, the mosque became too small. Canopies were hung from its front, but because they were low the worshippers found them troublesome—until Allah stored up the reward of completing the work for the record of al-Dakhil. He purchased the second half from the Christians for 100,000 dinars, the sum being accepted in the presence of a great crowd; after some initial reluctance, they consented. From the proceeds of the khums (statutory one-fifth of booty) he built this congregational mosque, the pride and ornament of the earth, and completed it exactly as he wished. Its foundation was laid in 170 AH, and its walls were finished within a single year.
The total expenditure reached 80,000 dinars, and Dihya al-Balawī said:
For the sake of God and seeking His Face
he brought forth eighty thousand of silver and gold,
and spent them on a mosque whose foundation is piety,
whose bounty is the religion of the Prophet Muḥammad. (1)
You see fiery gold between its lofty beams,
flashing like the gleam of blazing lightning. (2)
He also said:
You built, for the people of faith in the West, a mosque
where the All-Merciful is bowed to and prostrated;
You gathered for it masters of every craft,
and—by God’s favor—it rose a house made glorious.
They tarried over it less than a single year, no more,
until they raised it high, impregnable and secure.