A mellah (ملاح or 'saline area'; and מלאח) is the place of residence historically assigned to Jewish communities in Morocco. The urban mellah, as it exists in numerous cities and large towns, is a Jewish quarter enclosed by a wall and a fortified gateway, typically near the residence of the sultan or governor. In cities, the mellah was usually situated near the qaṣba (citadel), the royal palace, or the residence of the governor; some residents of the mellah held senior administrative positions and had to be available. The rural mellah, as it exists or existed in the mountainous regions of the Atlas and the Rif and in the plains regions reaching to the Sahara, is a relatively isolated open village inhabited exclusively by Jews. These villages existed at a distance from the nearest qṣar or qaid. Starting in the 15th century in Fes and especially since the beginning of the 19th century elsewhere, mellah districts were established in many Moroccan cities for the Jewish communities to live in. The name mellah derives from a local toponym in Fes which became the name of the first separate Jewish district in Morocco (the Mellah of Fez) created in that city during the 15th century. Haim Zafrani notes that the institution of the mellah was only imposed on some communities and only as of relatively recently in Moroccan history, and that segregation was not the rule in Islamic lands as it was in Christian lands. Mellah of Fez 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 ("Caravanserai 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 University of al-Qarawiyyin in the heart of the city.