The Rif War was an armed conflict fought from 1911 to 1927 between the colonial power Spain and the Berber tribes of the Rif mountainous region of Morocco. Led by Abd el-Krim, the Riffians at first inflicted several defeats on the Spanish forces by using guerrilla tactics and captured European weapons. After France's military intervention against Abd el-Krim's forces and the major landing of Spanish troops at Al Hoceima, considered the first amphibious landing in history to involve the use of tanks and aircraft, Abd el-Krim surrendered to the French and was taken into exile.
In 1909, Rifian tribes aggressively confronted Spanish workers of the iron mines of the Rif, near Melilla, which led to the intervention of the Spanish Army. The military operations in Jebala, in the Moroccan West, began in 1911 with the Larache Landing. 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.