 Spain worked to pacify a large part of the most violent areas until 1914, a slow process of consolidation of frontiers that lasted until 1919 due to World War I.The following year, after the signing of the Treaty of Fez, the northern Moroccan area was adjudicated to Spain as a protectorate.The Riffian populations strongly resisted the Spanish, unleashing a conflict that would last for several years.