After France signed the Treaty of Fez in 1912 enabling it to occupy Morocco, it then signed another treaty with Spain giving the country zones of influence in northern and southern Morocco. The northern part became the Spanish Protectorate of Morocco, while the southern part was added by Spain to its colony of Spanish Sahara, which extended South to the border with Mauritania. The Spanish Protectorate excluded the city of Tangiers, which became an international zone in 1923. It also excluded the cities of Ceuta, controlled by Spain since the 17th century, and Melilla, controlled by Spain since the 15th century. The city of Tetouan became the capital of the Spanish Protectorate.
From 1921-1926, local tribes in the Rif Mountains, led by Abd al-Karim al Khatami (Abdelkrim), established the Republic of the Rif, within the territory of the Spanish Protectorate. With help from French forces, the Spanish Army of Africa fought AbdelKrim’s guerilla army and eliminated the Republic. In 1936, the Spanish Army of Africa, under Francisco Franco, rose up against the Spanish republican government and catalyzed the Spanish Civil War. In 1940, the Spanish Army occupied Tangier, integrated it into the Protectorate, and removed Tangier’s international zone protections for Jews. Tangier became a major transit center for European refugees, particularly Jews. Spanish occupation of Tangier continued until 1945.
Most of the Jews in the Spanish Protectorate lived in Tetouan, where they made up about a sixth of the population. There also were Jews in the Atlantic coastal towns of Larache and Arcila and the mountain town of Chefchaouen. As Sephardim, they descended from the Jews exiled from Spain and Portugal in 1391 and 1492. They worked hard to preserve their Andalucian customs, such as speaking in Jewish-Spanish (Hekatia), maintaining Sephardic approaches to Jewish rituals and law, and creating a Spanish-Hebrew Association.
While Spain officially barred Jews from its territory, it treated them relatively well in the Protectorate. Abdelkrim and the Republic of Rif guerilla forces made efforts to protect the Jews. Nevertheless, they distrusted them, believing them to be allies of the Spanish colonial occupiers. The Moroccan nationalists who fought for independence honored Abdelkrim for his anticolonialist stance. They also questioned the degree to which Jews would support the anticolonial struggle.