Tangier's geographic location made it a centre for European diplomatic and commercial rivalry in Morocco in the late 19th and early 20th centuries. By the opening of the 20th century it had a population of about 40,000, including 20,000 Muslims (with Berbers predominating over Arabs), 10,000 Jews, and 9,000 Europeans (of whom 7,500 were Spanish). The city was increasingly coming under French influence, and it was here in 1905 that Kaiser Wilhelm II triggered an international crisis that almost led to war between his country and France by pronouncing himself in favour of Morocco's continued independence.
In 1912, Morocco was effectively partitioned between France and Spain, the latter occupying the country's far north (called Spanish Morocco) and a part of Moroccan territory in the south, while France declared a protectorate over the remainder. Tangier was made an international zone in 1923 under the joint administration of France, Spain, and Britain, joined by Italy in 1928.