Founded in 670 by Uqba bin Nafi, it was the seat of Arab governors in W Africa until 800. Under the Aghlabid dynasty (800-909), it remained the chief center of commerce and learning. It was the first capital (909-21) of the Fatimids.
Summarised extracts from a full article:
Al-Qayrawan (Tunisia) by Salah Zaimeche
One such buildings was Al-Qayrawan mosque, (Jamii Uqba) built sometime between 670 and 680 by Uqba ibn Nafi, the founder of the city of Qayrawan.
It witnessed transformations by a succession of rulers, and is one of the most prestigious and oldest religious shrine in western Islam.
In 845 al-Qayrawan became one of the main cultural centres of Islam, attracting students from all parts, including Muslim Spain.
At the end of the 9th centuy, a Bayt al-Hikmah (House of Wisdom) was established there rivalling its counterpart in Baghdad in the study of medicine, astronomy, engineering and translation.
At Qayrawan and Zaytuna in Tunisia, alongside the Quran and jurisprudence were taught grammar, mathematics, astronomy and medicine.
At Qayrawan, in particular, classes in medicine were delivered by Ziad. B. Khalfun, Ishak B. Imran and Ishak B. Sulayman, whose works were subsequently translated by Constantine The African in the 11th century. They were taught in the first faculty of medicine in Europe: Salerno, in the South of Italy, which became the first institution of high learning in Latin Europe.
Public education and al-Qayrawan were so deeply entwined that even women actively participated in the pursuit of learning there, and scholars, reigning monarchs and men from all walks of life seem to have supported eagerly the library of their town’s grand mosque.