 Spanish colonial policies in Spanish Morocco led to an uprising known as the Rif War; rebels took control of most of the area except for the enclaves of Ceuta and Melilla in 1921.King Alfonso XIII tacitly endorsed the September 1923 coup by General Miguel Primo de Rivera that installed a dictatorship.As Prime Minister Primo de Rivera promised to reform the country quickly and restore elections soon.