General Miguel Primo de Rivera's dictatorship over Spain began with a coup on 13 September 1923 and ended with his resignation on 28 January 1930. It took place during the wider reign of King Alfonso XIII. In establishing his dictatorship, Primo de Rivera ousted the liberal government led by Prime Minister Manuel García Prieto and initially gained the support of King Alfonso XIII and the army. During the Military Directory (1923–1925), the dictatorship created the official party of the regime, the Unión Patriótica (UP). It also censored the Spanish press and worked to eliminate separatism in Catalonia. Under Primo de Rivera's dictatorship, Spain won the Rif War, where Spanish forces fought Riffian tribes in Morocco.