merchant named Mohammed al-Fihri. The al-Fihri family had migrated from Kairouan (hence the name of the mosque), Tunisia to Fez in the early 9th century, joining a community of other migrants from Kairouan who had settled in a western district of the city. Fatima and her sister Mariam, both of whom were well educated, inherited a large amount of money from their father. Fatima vowed to spend her entire inheritance to build a mosque suitable for her community. Similarly, her sister Mariam is also reputed to have founded al-Andalusiyyin Mosque the same year. This foundation narrative has been questioned by some modern historians who see the symmetry of two sisters founding the two most famous mosques of Fez as too convenient and likely originating from a legend. Ibn Abi Zar is also judged by contemporary historians to be a relatively unreliable source. One of the biggest challenges to this story is a foundation inscription that was rediscovered during renovations to the mosque in the 20th century, previously hidden under layers of plaster for centuries. This inscription, carved onto cedar wood panels and written in a Kufic script very similar to foundation inscriptions in 9th-century Tunisia, was found on a wall above the probable site of the mosque's original mihrab (prior to the building's later expansions). The inscription, recorded and deciphered by Gaston Deverdun, proclaims the foundation of "this mosque" () by Dawud ibn Idris (a son of Idris II who governed this region of Morocco at the time) in Dhu al-Qadah 263 AH (July–August of 877 CE). Deverdun suggested the inscription may have come from another unidentified mosque and was moved here at a later period (probably 15th or 16th century) when the veneration of the Idrisids was resurgent in Fez, and such relics would have held enough religious significance to be reused in this way. However, Chafik Benchekroun argued more recently that a more likely explanation is that this inscription is the original foundation inscription of al-Qarawiyyin itself and that it might have been covered up in the 12th century just before the Almohads' arrival in the city. Based on this evidence and on the many doubts about Ibn Abi Zar's narrative, he argues that Fatima al-Fihri is quite possibly a legendary figure rather than a historical one. Early history Some scholars suggest that some teaching and instruction probably took place at al-Qarawiyyin Mosque from a very early period