When the French invaded Algiers in 1830, Sultan Abderrahman had to balance a moral obligation to help fellow Muslims in distress against the need to avoid conflict with the French. His ramshackle army of unreliable tribal levies and Ismail’s abid al-Bukhari’s remnants could not take on a European power. So Abderrahman tried to keep out of conflict with France, even though people in Algeria and many of his own subjects wanted him to fight. The leader of the resistance in western Algeria was the head of the Qadiriyya tariqa, Abd al-Qadir ibn Muhyi al-Din, who fought the French successfully and even set up a small state at Mascara until he was forced to flee across the Moroccan frontier in 1842. Abderrahman could not stop him from using Moroccan territory as a base, and, in July and August 1844, the French retaliated by occupying Oujda and bombarding coastal ports. Finally, the French army defeated the Moroccan army at Wadi Isly on the Algerian frontier, and Abderrahman sued for peace.
The Treaty of Tangier was mild – it insisted only that the border be properly marked – but the defeat at Isly undermined the sultan’s authority, and he lost legitimacy among Moroccans. He, therefore, began a military reform, creating a European-style army. It soon proved useless against Abd al-Qadir, let alone the French. It did no better in 1859-1860 when war with Spain led to their troops occupying Tétouan. This time the treaty (of Ras al-Oued) was more onerous: it enlarged the frontiers of Ceuta and Melilla, ceded Santa Cruz de la Mar Pequeña to Spain, and imposed a huge financial indemnity. Abderrahman’s successor, Mohammed IV (r.1859-1873), and then Hassan I (r.1873-1894) continued the army’s build-up, armed mainly with French and British weapons. They were trained by expatriate Frenchmen and Britons like the colorful qaid (administrator) Sir Harry Maclean. This was very expensive, and Abderrahman was an enthusiastic advocate of foreign trade. More ports were opened to commerce, and exports of grain, wool, skins, wax, and gum soared with European and American diplomatic representatives’ support. In December 1856, the British negotiated a trade treaty that opened Moroccan markets, and other European governments followed. However, foreign trade was dominated by the British until the 1890s, when competition from German and French companies increased.
The increase in trade changed Morocco profoundly. Growing imports of manufactured goods undermined Moroccan artisan manufacture, except for carpets, which sold well in the European middle-class market. Tea and sugar imports came to account for about 25 percent of total imports. The Moroccan population began to move to the Atlantic port towns, away from the interior’s old cities; Casablanca grew from a village into Morocco’s greatest port. The government elite was drawn from families that profited from the trade. Local traders became protégés of European diplomatic missions and gained exemption from Moroccan courts and taxes, thus undermining Moroccan sovereignty.
These capitulations were treaties between the North African and Middle Eastern states that emerged in the early modern period. Their original purpose was to encourage trade for the benefit of both sides. They provided that European traders should have expatriate status in Muslim territory in all commercial and criminal matters, with jurisdiction granted to the European consuls concerned. By the 19th century, they had become the excuse for European residents in Morocco (and elsewhere in the Middle East) to extract themselves from local political jurisdiction altogether and the burden of local taxation. Because these privileges were extended to these European traders’ local partners, the extent of European influence in Morocco grew dramatically. They have been considered an important element in the European subversion of Moroccan sovereignty. Most of the treaties encompassing the capitulations were abolished after the Protectorate was imposed, although the British did not abandon them until 1937.
The ulama considered these changes irreligious, and they lost out financially. Large parts of the population agreed: there were rebellions in some cities and localized jihads against the Europeans, particularly around Melilla in 1893 and 1909. These led to the imposition of further financial penalties on the government, increasing its burden of debt.
European governments attempted to solve the rapidly growing crisis by negotiation, holding a series of fruitless international conferences. European encroachments continued, not only in the cities but also on the periphery, particularly on the edges of the Sahara, where Hassan I attempted to extend his influence into the desert in the face of European encroachments. In 1879 British commercial adventurers set up a factory at Tarfaya. In 1887, the Spanish established a military post at Villa Cisneros (now Dakhla) even further south in the territories that became Río de Oro (Oued Eddahab or Wadi al-Dhahab) and Sakia al-Hamra, later the colony of Spanish Sahara. The sultan sent military expeditions to the south in the 1880s and 1890s to extract taxes and enforce loyalty among the tribes. He appointed a governor, Sheikh Mohammed Mustafa Ma al-Aynayn, who came from a prominent religious family in Mauritania. Sultan Abdelaziz subsidized Ma al-Aynayn’s vast new religious center at al-Semara. In the Atlas Mountains south of Marrakesh, Hassan I relied on local strongmen, particularly the Glaoui family, who would wield great influence during the Protectorate period.
In 1894, Hassan I died, having ensured his young son Abdelaziz, who was only 12 or 13 years old. The court chamberlain, Ba Ahmad, acted as regent, but several of the young sultan’s brothers opposed him. Ba Ahmad’s regime was far too weak to deal with all problems, and European interference grew rapidly. The balance of trade turned strongly against Morocco. European consuls began to exercise quasi-political authority, especially in Tangier, the diplomatic capital, which turned into a European enclave for tourists and émigrés.
In 1900, Ba Ahmad died, and the young sultan took over. In that year, the French army occupied the desert oasis of Tuat in the far south-east, claiming Moroccan territory for Algeria, and Morocco fell into bankruptcy, partly because of European-inspired reforms that were ostensibly intended to prevent just that. This involved building infrastructure, which was very expensive, and adopting a reformed tax system to pay for it did not produce any revenue. As Morocco’s finances fell into foreign hands due to European dominance of trade and increasingly onerous loans, so did its territory. French troops moved in from the Sahara, and, in 1904, the Entente Cordiale between Britain, France, and Russia traded British preponderance in Egypt for French preponderance in Morocco. The Spanish government was promised that its interests would be protected; only Germany protested, insisting on an international conference to settle the Moroccan question.
The Final Act of the Algeciras Conference in 1906 was signed by the foreign ministers of Europe and the United States. While it promised to preserve Moroccan sovereignty and territorial integrity, it placed Morocco’s administration, its customs, state bank, and police force under European control.
By now, Abdelaziz faced opposition across Morocco and the enmity of many of the ulama. The coastal cities, especially Casablanca, were particularly tense. In June 1907, French engineers building a light railway were attacked by local men, and a French warship landed troops to occupy the town. Other French troops occupied Oujda in the east of the country. In August 1907, a movement began to replace Abdelaziz with his brother Abdelhafid, a pious scholar instead of the Europeans. In January 1908, the ulama of Fez declared their allegiance to him on the condition that he reject the Act of Algeciras, recover Casablanca and Oujda, expel European advisers, abolish foreign concessions, and reject un-Koranic taxes. The sultan could do none of these things. The tiny beginnings of a constitutionalist movement inspired by the revolution in Iran in 1906 and the Turkish revolution of 1908 did not concern him because he had no power that might be limited constitutionally. French agents were taking over the government’s operation, and French and Spanish troops were occupying more and more of the land. After rebellions in 1911 that challenged this military takeover of the land, the French sent an army to Fez, which secured Abdelhafid’s agreement to a protectorate on 12 of May 1912.
The Treaty of Fez guaranteed the religious authority of the sultan and his secular sovereignty but placed all executive power in the hands of the French. The Protectorate had begun.
Colonial Morocco: the Imposition of the Protectorate
The Protectorate divided Morocco between France, Spain, and an international zone in Tangier. Spanish troops already occupied some districts, the enclaves on the Mediterranean coast were historic possessions, and the French had promised to preserve Spanish ‘interests’. The Zone of Spanish Influence (not a separate protectorate) included the mountains along the Mediterranean coast in the north and a piece of sandy territory around Tarfaya in the far south, about 43,000 square kilometers. The sultan remained the sovereign. The northern enclaves, Santa Cruz de la Mar Pequeña or Ifni, and Río de Oro and Sakia al-Hamra (the future Spanish Sahara) were excluded. The city of Tangier, which the consular corps had run since the mid-19th century, was placed under international control in 1923, once again maintaining the fictional sovereignty of the sultan. The French held most of Morocco and established its modern administration and law.
Although the sovereignty of the sultan was maintained, Abdelhafid was replaced by his brother Yusef. The highest French authority was the resident-general, to which post-Paris appointed Hubert Lyautey, an experienced colonial soldier with clear ideas about how to govern and conquer the country. He faced opposition from a son of Ma al-Aynayn, Ahmad al-Hiba, who called for a jihad in the south that was quickly defeated, and more diffuse but determined opposition among the tribes in the High Atlas, which was more difficult to overcome. The conquest was not completed until 1936.