In 1930, due to economic problems and general unpopularity, Primo de Rivera resigned. Alfonso as Primo de Rivera's ally shared the popular dislike. In April 1931, General José Sanjurjo told him even the army was not loyal. On 12 April, the republican parties won a landslide victory in municipal elections. On 14 April, he fled the country as the Second Spanish Republic was proclaimed, but did not abdicate. He settled eventually in Rome.