information:classification, structural:scholar_edition
French colonial rule

The French invasion of Morocco began in the east with General Hubert Lyautey 's occupation of Oujda in March 1907 and in the west with the Bombardment of Casablanca in August 1907. The Treaty of Fes established the protectorate in March 1912. Acting as French administrator of Morocco, Lyautey decided to relocate the country's capital from Fes to Rabat after the riots of 1912 following the Treaty of Fes. Lyautey appears to have had a personal affinity for Rabat. He argued that its coastal location was more pleasant and more accessible, and that its proximity to Casablanca, which he estimated would become the major economic center, would be advantageous. In 1913, Lyautey hired Henri Prost to design the Ville Nouvelle (Rabat's modern quarter) as an administrative sector, as he did in other major Moroccan cities.

The colonial period resulted in major economic changes as well as accelerated urbanization. Prior to this period, the major cities of Morocco had always been Fez and Marrakesh, while the coastal cities were relatively small. Census figures are not available for the early years of the Protectorate, but in 1912 Rabat and nearby Salé can be estimated to have had about 35,000 to 40,000 inhabitants at most, according to Janet Abu-Lughod. One early French survey, based on the number of houses rather than a formal census, estimated the population of Rabat to be 25,642. A formal census in 1921 counted the population as 33,714. Some of this growth was due to the immigration of foreigners. In 1921, 59% of the population were Moroccan Muslims and 10% were Moroccan Jews, while 21.4% were French nationals and another 10% were foreigners of other origin. Nearby Salé, however, remained more homogenously Moroccan. Rabat's population grew to approximately 83,000 in 1936 and to approximately 156,000 in 1952.