09 August 1921,
Abd el-Krim defeated the Spanish Army at the Annual Battle and proclaimed the Republic of the Rif. The failure of Spain caused an earthquake in the Spanish State, with almost 12,000 deaths of soldiers and a strong strengthening of movements against recruitment. Alfonso's reign XIII.aren wobbled, but Miguel Primo de Rivera struck the coup. In 1924, commissioned by Primo de Rivera, Spain began a cruel war campaign in North Africa, with chemical weapons attacks from planes on civilians and abolished the Republic of the Rif.
Source:
Wikipedia – Rif War.