During World War II, after promotion to luogotenente generale (major general), in July 1942 he became commander of the garrison of Ljubljana and of the Blackshirt Tactical Group "Montagna" (made up of the 2nd Blackshirt Mountain Legion "Alpina" and of the 71st and 81st Blackshirt Battalions), later renamed Blackshirt Groupment "XXI Aprile", part of General Mario Robotti's XI Army Corps; he was awarded a third bronze medal for his role in anti-partisan operations between July and November 1942. He was replaced in this post by Niccolò Nicchiarelli on 19 April 1943 and returned to Italy, where after the fall of the Fascist regime on 25 July he was arrested in his estate in Santa Giuletta by the new government in August. He was then imprisoned in Forte Boccea in Rome, along with Enzo Galbiati, Ubaldo Soddu, Ugo Cavallero, Augusto Agostini (former commander of the Forestry Militia) and Guido Buffarini Guidi, but was freed by the Germans after the Armistice of Cassibile on the following 12 September; following an agreement with the German commands, he immediately set out to reconstitute the Voluntary Militia for National Security and on 17 September 1943 he took seat in the former General Command of the MVSN in Rome, which had been abandoned after 25 July. As the highest ranking Blackshirt officer in Rome, he took over from Italo Romegialli as provisional Commander-General of the MVSN; he retrieved some M13/40 tanks and L6/40 tanks and arranged them to protect the most sensitive targets such as the "Mussolini" Barracks and the headquarters of the newly established Republican Fascist Party in Palazzo Wedekind, of which he also managed the provincial section until the arrival of Alessandro Pavolini on September 18.[1][2][5][6][7][8]
After Pavolini assumed command over the Roman Fascists in the following days, Montagna dedicated himself completely to MVSN. According to him, the National Republican Army (military of the Italian Social Republic) should have been born as an extension of the MVSN, the only armed force that had not dissolved after the armistice and had maintained its alliance with the Germans; he lamented how the MVSN had been merged completely into the National Republican Guard together with the Carabinieri and the PAI, losing its military character to become what was "essentially a police force". On 11 November 1943 he was appointed commander of the 208th (Marche) Regional Military Command, with headquarters in Macerata, until the evacuation of RSI forces in the region in July 1944. In January 1944 he was appointed judge in the Verona Trial against the members of the Grand Council of Fascism who had voted the order of the day which had resulted in the fall of the Mussolini government on 25 July 1943. Montagna argued that Marshal of Italy Emilio De Bono should not be sentenced to death, but his efforts were frustrated by the opposition of the intransigent Enrico Vezzalini.[1][9][10][11]
At dawn on 9 July 1944, while he was spending the night in his villa in Monteceresino (near Santa Giuletta), Montagna was subjected to an attempted kidnapping by members of the Italian Resistance, which was however repelled by the guards and by Montagna himself; one partisan was killed. Montagna was later appointed commander of the 206th (Piedmont) Regional Military Command, with headquarters in Alessandria, until 4 October 1944, when he became commander of the Republican Police Corps, a post he held until the end of the war. In early 1945 he was also briefly appointed commander of the 205th (Lombardy) Regional Military Command, with headquarters in Milan.[1][12]
In mid-April 1945 Montagna, with Mussolini's permission, made contact with representatives of the Milanese National Liberation Committee, without any concrete result. He became a fugitive after the end of the war, until he was amnestied by the Court of Assize of Como on 29 May 1947. He then retired to private life, dying in Voghera on 6 July 1978.[1][13]