However, during less than half a century of colonization, the equilibrium between Jews and Muslims in Morocco was upset, and the Jewish community was again positioned between the colonisers and the Muslim majority.
French penetration into Morocco between 19 created significant Morocco Muslim resentment, resulting in nationwide protests and military unrest.
A further 200,000 lived in Pahlavi Iran and the Republic of Turkey.
The first large-scale exoduses took place in the late 1940s and early 1950s, primarily from Iraq, Yemen and Libya.
During the period a number of anti-European or anti-French protests extended to include anti-Jewish manifestations, such as in Casablanca, Oujda and Fes in 1907-08 and later in the 1912 Fes riots.
The situation in colonial Libya was similar; as for the French in the other North African countries, the Italian influence in Libya was welcomed by the Jewish community, increasing their separation from the non-Jewish Libyans.
However, according to the Hebrew University of Jerusalem's Dr.
Haim Saadon, "Relatively good ties between Jews and Muslims in North Africa during World War II stand in stark contrast to the treatment of their co-religionists by gentiles in Europe." As in Tunisia and Algeria, Moroccan Jews did not face large scale expulsion or outright asset confiscation or any similar government persecution during the period of exile, and Zionist agents were relatively allowed freedom of action to encourage emigration.
The following century had a profound influence on the status of the Algerian Jews; following the 1870 "Décret Crémieux", they were elevated from the protected minority dhimmi status to French citizens of the colonial power.
Morocco, which had remained independent during the 19th century, became a French protectorate in 1912.
primarily of Sephardi and Mizrahi background, from Arab and Muslim countries, mainly from 1948 to the early 1970s.
A number of small-scale Jewish exoduses began in many Middle Eastern countries early in the 20th century with the only substantial aliyah coming from Yemen and Syria.
Jews expelled from the Iberian Peninsula were invited to settle in various parts of the Ottoman Empire, where they would often form a prosperous model minority of merchants acting as intermediaries for their Muslim rulers.