[3] In 1931, following the proclamation of the Second Spanish Republic, the president of the Generalitat de Catalunya, Francesc Macià, appointed him head of the Mossos d'Esquadra.
[8] The victory of the Popular Front in the 1936 Spanish general election caused him to be pardoned and released,[9] being readmitted to the army.
With the Generalitat restored, he regained his position at the head of the Mossos and was one of the officers who contributed to quelling the July 1936 military uprising in Barcelona,[10] when he directed the attack on the headquarters of the Captaincy General of Catalunya and arrested Manuel Goded, leader of the military rebellion in Barcelona.
[13] He returned to Barcelona and spent the rest of the war in bureaucratic positions, as military governor of Tarragona and, later, of Girona.
He collaborated with articles on military strategy in the magazine Quaderns de l'exili and proposed to form a unit of Catalan soldiers together with the Allies during the Second World War.