[1] 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.
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).
[5][6] 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.
[7][4] In 1276 the Marinid sultan Abu Yusuf Yaqub ibn Abd al-Haqq founded Fes el-Jdid, a new fortified administrative city to house their troops and the royal palace.
[5][8] 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.
[5] Some authors argue that the transfer likely happened in stages across the Marinid period (late 13th to 15th centuries), particularly following episodes of violence or repression against Jews in the old city.
[4] The urban fabric of the Mellah appears to have developed progressively and it's possible that a small Jewish population settled here right after the foundation of Fes el-Jdid and that other Jews fleeing the old city joined them later.
Some scholars, citing historical Jewish chronicles, attribute the date of the move more specifically to the "rediscovery" of Idris II's body in his zawiya at the center of the old city (Fes el-Bali) in 1437.
The 15th century was also a time of relative political instability, with the Wattasid viziers taking over effective control from the Marinid dynasty and competing with other local factions in Fez.
[12] In 1465, the Mellah was attacked by the Muslim population of Fes el-Bali during a revolt led by the shurafa (noble sharifian families) against the Marinid sultan Abd al-Haqq II and his Jewish vizier Harun ibn Battash.
The following waves of Spanish Jews migrating to Fez and North Africa increased the Jewish population and also altered its social, ethnic, and linguistic makeup.
In 1557-58 CE sultan Moulay Abdallah al-Ghalib ordered that the Jewish population of the city relocate from here to an area next to the royal Kasbah (citadel), and construction of the new Mellah of Marrakesh was probably finished around 1562-63.
"[1] In 1791, a European traveller described the Marrakesh mellah: "It has two large gates, which are regularly shut every evening about nine o'clock, after which time no person whatever is permitted to enter or go out... till... the following morning.
[citation needed] The third mellah of Morocco wasn't created until 1682, when the Alaouite sultan Moulay Isma'il moved the Jewish population of Meknes, his new capital, to a new district on the southwest side of the city, next to the vast new royal citadel that he was building for himself there.
[4][5] It was only after the sultan's death that the chief Muslim qadi (judge) of Fez ordered the Mellah to be restored to the Jewish community, along with the demolition of the mosque built by Yazid's troops.
[12] At the beginning of the 19th century, around 1807, sultan Sulayman forced Jews to move to mellahs in the towns of the coastal region, in Rabat, Salé, Essaouira, and Tetouan.
[12] This also led to a greater social openness and a shift in tastes and attitudes, especially among richer Jews, who built luxurious residences in the upper parts of the Mellah there.
[12] In the early twentieth century affluent Jews started to move to the new neighborhoods (Villes nouvelles) planned along European urban schemes, leaving in the mellahs only the elderly and the poorest families.
[25]"The one gate that gave way to the medina, which could have easily been repudiated as an emblem of imprisonment, instead came to be treated as an object of reverence by the mellah ’s inhabitants, as we see in this description from the early twentieth century: If one stops for a moment in front of this gate, one sees a curious thing: All who pass, children, beggars, peddlers driving their donkeys loaded with merchandise, old women, hunched-over men, all approach this dusty wall and press their lips against it with as much fervor as if they were kissing the holy Torah.
Even the synagogue itself facilitated a wide variety of Jewish communal needs including education, ritual baths, and spaces for children to play.
[14]: 35–36 While at first these quarters offered considerable comfort to Jewish families, with spacious homes and protection due to proximity to the royal palace these luxuries soon came to a close.
[14]: 73 Separation certainly stifled cultural interaction to some degree, but Muslims were allowed to enter the mellah and did so if they needed goods and services that fell within the Jewish niche.