The library was once linked with the neighboring Qarawiyyin Mosque. They are considered to be the two centers of learning and cultural life in old Fez.