At the outbreak of World War II in 1939, the sultan issued a call for cooperation with the French, and a large Moroccan contingent (mainly Amazigh) served with distinction in France. The collapse of the French in 1940 followed by the installation of the Vichy regime produced an entirely new situation. The sultan signified his independence by refusing to approve anti-Jewish legislation. When Anglo-American troop landings took place in 1942, he refused to comply with the suggestion of the resident general, Auguste Noguès, that he retire to the interior. In 1943 the sultan was influenced by his meeting with U.S. Pres. Franklin D. Roosevelt, who had come to Morocco for the Casablanca Conference and was unsympathetic to continued French presence there. The majority of the people were equally affected by the arrival of U.S. and British troops, who exposed Moroccans to the outside world to an unprecedented degree. In addition, Allied and Axis radio propaganda, which called for Moroccan independence, strongly attracted Arab listeners. Amid these circumstances, the nationalist movement took the new title of Ḥizb al-Istiqlāl (Independence Party). In January 1944 the party submitted to the sultan and the Allied (including the French) authorities a memorandum asking for independence under a constitutional regime. The nationalist leaders, including Aḥmad Balafrej, secretary general of the Istiqlāl, were unjustly accused and arrested for collaborating with the Nazis. This caused rioting in Fès and elsewhere in which some 30 or more demonstrators were killed. As a result, the sultan, who in 1947 persuaded a new and reform-minded resident general, Eirik Labonne, to ask the French government to grant him permission to make an official state visit to Tangier, passing through the Spanish Zone on the way. The journey became a triumphal procession. When the sultan made his speech in Tangier, after his stirring reception in northern Morocco, he emphasized his country’s links with the Arab world of the East, omitting the expected flattering reference to the French protectorate.

Labonne was subsequently replaced by Gen. (later Marshal) Alphonse Juin, who was of Algerian settler origin. Juin, long experienced in North African affairs, expressed sympathy for the patriotic nationalist sentiments of young Moroccans and promised to comply with their wish for the creation of elected municipalities in the large cities. At the same time, he roused opposition by proposing to introduce French citizens as members of these bodies. The sultan used his one remaining prerogative and refused to countersign the resident general’s decrees, without which they had no legal validity. A state visit to France in October 1950 and a flattering reception there did nothing to modify the sultan’s views, and on his return to Morocco he received a wildly enthusiastic welcome.

In December General Juin dismissed a nationalist member from a budget proposal meeting of the Council of Government; consequently, the 10 remaining nationalist members walked out in protest. Juin then contemplated the possibility of using the Amazigh feudal notables, such as Thami al-Glaoui, to counter the nationalists. At a palace reception later in the month al-Glaoui in fact confronted the sultan, calling him not the sultan of the Moroccans but of the Istiqlāl and blaming him for leading the country to catastrophe.

With Sīdī Muḥammad still refusing to cooperate, Juin surrounded the palace, under the guard of French troops supposedly placed there to protect the sultan from his own people, with local tribesmen. Faced with this threat, Sīdī Muḥammad was forced to disown “a certain political party,” without specifically naming it, though he still withheld his signature from many decrees, including one that admitted French citizens to become municipal councillors. Juin’s action was widely criticized in France, which led to his replacement by Gen. Augustin Guillaume in August 1951. On the anniversary of his accession (November 18), the sultan declared his hopes for an agreement “guaranteeing full sovereignty to Morocco” but (as he added in a subsequent letter addressed to the president of the French Republic) “with the continuation of Franco-Moroccan cooperation.” This troubled situation continued until December 1952, when trade unions in Casablanca organized a protest meeting in response to the alleged French terrorist assassination of the Tunisian union leader Ferhat Hached. Subsequently, a clash with the police resulted in the arrest of hundreds of nationalists, who were held for two years without trial.

In April 1953 ʿAbd al-Ḥayy al-Kattānī, a noted religious scholar and the head of the Kattāniyyah religious brotherhood, and a number of Amazigh notables led by al-Glaoui (along with the connivance of several French officials and settlers) began to work for the deposition of the sultan. The government in Paris, preoccupied with internal affairs, finally demanded that the sultan transfer his legislative powers to a council, consisting of Moroccan ministers and French directors, and append his signature to all blocked legislation. Although the sultan yielded, it was insufficient for his enemies. In August al-Glaoui delivered the equivalent of an ultimatum to the French government, who deported the sultan and his family and appointed in his place the more subservient Mawlāy Ben ʿArafa. These actions failed to remedy the situation, as Sīdī Muḥammad immediately became a national hero. The authorities in the Spanish Zone, who had not been consulted about the measure, did nothing to conceal their disapproval. The Spanish Zone thus became a refuge for Moroccan nationalists.

In November 1954 the French position was further complicated by the outbreak of the Algerian war for independence, and the following June the Paris government decided on a complete change of policy and appointed Gilbert Grandval as resident general. His efforts at conciliation, obstructed by tacit opposition among many officials and the outspoken hostility of the majority of French settlers, failed. A conference of Moroccan representatives was then summoned to meet in France, where it was agreed that the substitute sultan be replaced with a crown council. Sīdī Muḥammad approved this proposal, but it took weeks to persuade Mawlāy Ben ʿArafa to withdraw to Tangier. Meanwhile, a guerrilla liberation army began to operate against French posts near the Spanish Zone.

In October al-Glaoui declared publicly that only the restoration of Muḥammad V could restore harmony. The French government agreed to allow the sultan to form a constitutional government for Morocco, and Sīdī Muḥammad returned to Rabat in November; on March 2, 1956, independence was proclaimed. The sultan formed a government that included representation from various elements of the indigenous population, while the governmental departments formerly headed by French officials became ministries headed by Moroccans.

The Spanish Zone

The Spanish protectorate over northern Morocco extended from Larache (El-Araish) on the Atlantic to 30 miles (48 km) beyond Melilla (already a Spanish possession) on the Mediterranean. The mountainous Tamazight-speaking area had often escaped the sultan’s control. Spain also received a strip of desert land in the southwest, known as Tarfaya, adjoining Spanish Sahara. In 1934, when the French occupied southern Morocco, the Spanish took Ifni.

Spain appointed a khalīfah, or viceroy, chosen from the Moroccan royal family as nominal head of state and provided him with a puppet Moroccan government. This enabled Spain to conduct affairs independently of the French Zone while nominally preserving Moroccan unity. Tangier, though it had a Spanish-speaking population of 40,000, received a special international administration under a mandūb, or a representative of the sultan. Although the mandūb was, in theory, appointed by the sultan, in reality he was chosen by the French. In 1940, after the defeat of France, Spanish troops occupied Tangier, but they withdrew in 1945 after the Allied victory.

The Spanish Zone surrounded the ports of Ceuta and Melilla, which Spain had held for centuries, and included the iron mines of the Rif Mountains. The Spanish selected Tétouan for their capital. As in the French Zone, European-staffed departments were created, while the rural districts were administered by interventores, corresponding to the French contrôleurs civils. The first area to be occupied was on the plain, facing the Atlantic, that included the towns of Larache, Ksar el-Kebir, and Asilah. That area was the stronghold of the former Moroccan governor Aḥmad al-Raisūnī (Raisūlī), who was half patriot and half brigand. The Spanish government found it difficult to tolerate his independence; in March 1913 al-Raisūnī retired into a refuge in the mountains, where he remained until his capture 12 years later by another Moroccan leader, Abd el-Krim.

Abd el-Krim was an Amazigh and a good Arabic scholar who had a knowledge of both the Arabic and Spanish languages and ways of life. Imprisoned after World War I for his subversive activities, he later went to Ajdir in the Rif Mountains to plan an uprising. In July 1921 Abd el-Krim destroyed a Spanish force sent against him and subsequently established the Republic of the Rif, which was formally constituted as an independent state in 1923. It took a combined French and Spanish force numbering more than 250,000 troops before he was defeated. In May 1926 he surrendered to the French and was exiled.

The remainder of the period of the Spanish protectorate was relatively calm. Thus, in 1936, Gen. Francisco Franco was able to launch his attack on the Spanish Republic from Morocco and to enroll a large number of Moroccan volunteers, who served him loyally in the Spanish Civil War. Though the Spanish had fewer resources than the French, their subsequent regime was in some respects more liberal and less subject to ethnic discrimination. The language of instruction in the schools was Arabic rather than Spanish, and Moroccan students were encouraged to go to Egypt for a Muslim education. There was no attempt to set Amazigh against Arab as in the French Zone, but this might have been the result of the introduction of Muslim law by Abd el-Krim himself. After the Republic of the Rif was suppressed, there was little cooperation between the two protecting powers. Their disagreement reached a new intensity in 1953 when the French deposed and deported the sultan. The Spanish high commissioner, who had not been consulted, refused to recognize this action and continued to regard Muḥammad V as the sovereign in the Spanish Zone. Nationalists forced to leave the French area used the Spanish Zone as a refuge.

In 1956, however, the Spanish authorities were taken by surprise when the French decided to grant independence to Morocco. A corresponding agreement with the Spanish was nevertheless reached on April 7, 1956, and was marked by a visit of the sultan to Spain. The Spanish protectorate was thus brought to an end without the troubles that marked the termination of French control. With the end of the Spanish protectorate and the withdrawal of the Spanish high commissioner, the Moroccan khalīfah, and other officials from Tétouan, the city again became a quiet, provincial capital. The introduction of the Moroccan franc to replace the peseta as currency, however, caused a great rise in the cost of living in the former Spanish area, along with difficulties brought on by the introduction of French-speaking Moroccan officials. In 1958–59 these changes generated disorders in the Rif region. Tangier, too, lost much of the superficial brilliance it had developed as a separate zone. As in the former French Zone, many European and Jewish inhabitants left. The southern protectorate area of Tarfaya was handed back to Morocco in 1958, while the Spanish unconditionally gave up Ifni in 1970, hoping to gain recognition of their rights to Melilla and Ceuta.

Ceuta, on the Strait of Gibraltar, and Melilla, farther east on the Mediterranean coast, continue to be Spanish presidios on Moroccan soil, both with overwhelmingly Spanish populations. In October 1978 the United States turned over to Morocco a military base, its last in Africa, at Kenitra.