Republic of the Rif

The Republic of the Rif (Berber: "Tagduda en Arrif", "Jumhūriyya ar-Rīf"), officially The Confederal Republic of the Tribes of the Rif, also recorded as the Riff, was a short-lived republic in northern Morocco that existed between 1921 and 1926. It was created in September 1921, when the people of the Rif revolted and declared their independence from Spanish occupation as well as from the Moroccan Alawite sultan, Yusef.
History.
In 1921, Riffians under the leadership of Abd el-Krim crushed a Spanish offensive under General Manuel Fernández Silvestre at the Battle of Annual and soon after declared an independent republic on 18 September 1921. The republic was formally constituted in 1923 with Abd el-Krim as Head of state and Ben Hajj Hatmi as Prime Minister.
Abd el-Krim defeated the Spanish many times and drove them back to a few coastal outposts. He wanted to create a stable state for the Berbers to shield them from the long years of fighting. Abd el-Krim sent diplomatic representatives to London and Paris to try to establish diplomatic relations with Europe.
In late 1925, the French and Spanish created a joint task force of half a million men supported by tanks and aircraft. From 1923 onwards, the Spanish used German-designed chemical weapons. The Republic of the Rif was dissolved by Spanish and French occupation forces on 27 May 1926, after the long and bloody battles of the Rif War in which German-designed chemical weapons were used against the Berber populations by Spanish and French occupation forces but many Rif guerrillas continued to fight until 1927.