Jewish ghetto in Morocco. The mellah was usually walled with a fortified gateway. Frequently, the mellah was located to a corner of the city, having its own gates, allowing full segration between Jews and Muslims.
Mellah in Fez, Morocco.
Mellah and synagogue in Azzemour, Morocco.
The term, meaning "salt", appears to have come from a specific job reserved for the Jews of Fez; to salt the heads of heads brought home by soldiers as trophies.
The system of isolating the Jews was both discriminatory as well as a method of protecting them from Muslim violence. The rule was that the gates to the mellah were closed during night.
In many places around Morocco, the Jews lived in Muslim quarters. Still, Jews did not enjoy the freedom of Muslims. In and around Fez, the rule was that no Jew could ride or ear shoes outside the Mellah, and could only travel the country after applying for a permit.
1438: The first mellah is established in Fez.
1465: A majority of the Jews of Fez are massacred by Muslim thugs.
Mid 16th century: A mellah is established in Marrakech.
1682: A mellah is established in Meknes.
Early 19th century: Across Morocco, Jews are forced to settle in mellahs, many newly established.
Mid 20th century: Large-scale emigrations of Jews from Morocco to Israel; houses and property are abandoned, usually without compensation, and left for the Muslim locals. The mellahs become Muslim neighbourhoods.