Established by the Arab general Uqba ibn Nafi in 670 AD (the year 50 according to the Islamic calendar) at the founding of the city of Kairouan, the mosque is spread over a surface area of 9,000 square metres and it is one of the oldest places of worship in the Islamic world, as well as a model for all later mosques in the Maghreb. The Great Mosque of Kairouan is one of the most impressive and largest Islamic monuments in North Africa; its perimeter is almost equal to 405 metres (1,328 feet). This vast space contains a hypostyle prayer hall, a huge marble-paved courtyard and a massive square minaret. In addition to its spiritual prestige, the Mosque of Uqba is one of the masterpieces of both architecture and Islamic art.
Under the Aghlabids (9th century), huge works gave the mosque its present aspect. The fame of the Mosque of Uqba and of the other holy sites at Kairouan helped the city to develop and repopulate increasingly. The university, consisting of scholars who taught in the mosque, was a centre of education both in Islamic thought and in the secular sciences. Its role can be compared to that of the University of Paris in the Middle Ages. With the decline of the city of Kairouan from the mid 11th century, the centre of intellectual thought moved to the University of Ez-Zitouna in Tunis.
At the foundation of Kairouan in 670, the Arab general and conqueror Uqba Ibn Nafi (himself the founder of the city) chose the site of his mosque in the center of the city, near the headquarters of the governor. Around 690, shortly after its construction, the mosque was destroyed during the occupation of Kairouan by the Berbers, originally conducted by Kusaila. It was rebuilt by the Ghassanid general Hasan ibn al-Nu'man in 703.
Interior view of the hypostyle prayer hall in the Mosque of Uqba (Great Mosque of Kairouan)
With the gradual increase of the population of Kairouan and the consequent increase in the number of faithful, Hisham ibn Abd al-Malik, Umayyad Caliph in Damascus, charged his governor Bishr ibn Safwan to carry out development work in the city which include the renovation and expansion of the mosque around the years 724–728. In view of its expansion, he pulled down the mosque and rebuilt it with the exception of the mihrab. It was under his auspices that the construction of the minaret began. In 774, a new reconstruction accompanied by modifications and embellishments took place under the direction of the Abbasid governor Yazid Ibn Hatim.
Under the rule of Aghlabid sovereigns, Kairouan was at its apogee, and the mosque profited from this period of stability and prosperity. In 836, Ziadet-Allah I reconstructed the mosque once more, this is when the building acquired, at least in its entirety, the appearance we see today. At the same time, the mihrab's ribbed dome on squinches was raised. Around 862-863, Abul Ibrahim enlarged the oratory, with three bays to the north, and added the cupola over the arched portico which precedes the prayer hall. In 875 Ibrahim II built another three bays, thereby reducing the size of the courtyard which was further limited on the three other sides by the addition of double galleries.
The outside has many buttresses. Here is the northwest corner.
The current state of the mosque can be traced back to the reign of Aghlabids—no element is earlier than the ninth century besides the mihrab—except for some partial restorations and a few later additions made in 1025 during the reign of Zirids, 1248 and 1293-1294 under the reign of Hafsids, 1618 at the time of mouradites beys, in the late nineteenth and early twentieth century. In 1967, major restoration works, executed during five years and conducted under the direction of the National Institute of Archeology and Art, were achieved throughout the monument, and were ended with an official reopening of the mosque during the celebration of Mawlid of 1972.
(source)