The most important mosque in Morocco, and one of the oldest universities in the world, can only be seen from the outside for non-Muslims. It was built in 859 by Fatima el Fihria, the daughter of a wealthy immigrant from Kairouan, Tunisia, and by the 10th century had become the congregational mosque of the Kairouine quarter of the medina. Surrounded by medersas, it became a major intellectual center in medieval Mediterranean; a popular tradition suggests Pope Sylvester II, who was instrumental in western Europe's adoption of Arabic numerals, was once a student here. This Mediterranean connection is evident in both the 12th-century Almoravid minbar (pulpit), made from precious wood and inlaid ivory and originally from the then-great Islamic center of Cordoba, and two flanking early-17th-century Saâdian pavilions modeled on those of the Lion Court in the Alhambra at Grenada. Two chandeliers inside the mosque were church bells of Andalusian origin.

Such is the mosque's concealment by the surrounding shops and businesses that it's hard to tell from the outside that more than 20,000 worshipers can attend prayers inside, under the vaults supported by 270 columns.

The best interior view non-Muslims can manage is from the main entrance opposite the Attarine and Mesbahiya medersas, from where it's possible to see the Saâdian pavilions to the far right (if you're standing on the far left side of the door). If you continue around the perimeter of the mosque to Seffarine Square, you'll come to the entrance to the Kairouine Library, unfortunately also off-limits to non-Muslims. This once held one of the greatest collections of Islamic literature in all of Arabia and was a place of pilgrimage for those seeking intellectual and spiritual knowledge. Much of the library's collection was lost in the 17th century, but some precious manuscripts and volumes have survived. The present reading room was built in 1940 by Mohammed V and has recently been restored and reopened to Muslim scholars.