Mosque of the Andalusians
The Mosque of the Andalusians stands in Fes el-Bali, the old medina of Fez, in the quarter settled by refugees from Cordoba who fled to Morocco in 818 after a failed uprising. It was founded in 859 or 860 by Maryam al-Fihri, with money from the Andalusi families whose name it bears.
In 933 the Fatimid governor of Fez transferred the Friday sermon to it, making it the chief mosque of the Andalusian quarter. The building was almost entirely reconstructed between 1203 and 1207 on the orders of the Almohad caliph Muhammad al-Nasir, who added the northern gate and a water channel feeding its ablutions house.
Marinid sultans kept up the work: Abu Ya'qub Yusuf repaired it in 1295, and Abu Sa'id Uthman III founded its library in 1415, confirming it as the second mosque of Fez after the Qarawiyyin mosque.