The first "Mellah" of Morocco was created in the city of Fez. Fez had long hosted the largest and one of the oldest Jewish communities in Morocco, present since the city's foundation by the Idrisids (in the late 8th or early 9th century). Since the time of Idris II (early 9th century) a Jewish community was concentrated in the neighbourhood known as "Foundouk el-Yihoudi" ("hotel/warehouse of the Jew") near Bab Guissa in the northeast of the city. Nonetheless, historical evidence also shows that the Jewish population was widely distributed in many parts of the old city (Fes el-Bali) alongside the Muslim population, including near the Qarawiyyin Mosque in the heart of the city.In 1276 the Marinid sultan Abu Yusuf Ya'qub founded Fes el-Jdid, a new fortified administrative city to house their troops and the royal palace. The city included a southern district, known as "Hims", which was initially inhabited by Muslim garrisons, particularly the Sultan's mercenary contingents of Syrian archers which were later disbanded. The same district, however, was also known by the name "Mellah" ( or 'saline area') due to either a saline water source in the area or to the presence of a former salt warehouse. It was this name which was later retained as the name of the subsequent Jewish quarter in the area. Afterwards, the name came to be associated by analogy with similar districts that were later created in other cities such as Marrakesh. The name "mellah" thus originally had no negative connotation but was rather just a local toponym. Nonetheless, over generations a number of legends and popular etymologies came to explain the origin of the word as a "salted, cursed ground" or a place where the Jews were forced to "salt" the heads of decapitated rebels.