Following the fall of the Italian "empire" in Africa and the allied invasion of Sicily July 1943, the Fascist Grand Council met 24 July for the first time since the beginning of the war. It overwhelmingly supported a resolution asking the king, Victor Emmanuel, to resume his powers, ie dismiss Benito Mussolini. The king immediately replaced Mussolini, who was arrested, with Marshal Pietro Badoglio. Badoglio assured the Germans that Italy remained loyal to the Axis but secret armistice negociations was begun with the Allies.
The armistice was announced 8 September and the king and government fled Rome for Brindisi. The Italian army was left without orders and virtually disintegrated as the Germans (who had prepared for this event) quickly occupied central and northern Italy (southern Italy was in the hands of the Allies).
Mussolini had been imprisoned on Island of Ponza but had later been moved to a hotel on the Gran Sasso d'Italia in the Abruzzi Mountains. German paratroopers, led by Otto Skorzeny, famously rescued him from Gran Sasso 12 Sep and transported him to Munich.

Mossolini was presuaded by Adolf Hitler into establishing a new fascist government in Italy and the Repubblica Sociale Italiana (RSI) (Italian Social Republic) was founded 23 September 1943 at Salò on the Garda Lake. The new regime was nothing more than a puppet regime which was controlled by Germany, still many Italians were still loyal to the Mussolini and new units were formed that would fight with the germans until the bitter end.
A new army, Esercito Nazionale Repubblicano consisting of volunteers were formed (attempts were made to presuade the Italian 630.000 pows taken when Italy joined the Allies to join, but only about 15.000 did). Four divisions were raised and sent to Germany for training and equiping before returning to Italy to fight the Allies but due to the mistrust from the Germans they were only used for anti-partisan duties.
The vast majority of the navy had joined the Allies and most of the remaining ships had been taken over by the Germans, but a new navy (which also included ground troops), Marina Nazionale Repubblicana, was formed. This fleet never reached more than a twentieth the size of the Italian fleet fighting for the Allies.
The majority of the air force remained loyal to Mussolini and was organised into the Aeronautica Nazionale Repubblicana. Units began forming spontaneously late 1943 but the first units were officially formed 1 Jan 1944 and operations began 3 Jan. It shot down 240 allied aircraft, mainly bombers, during it's existance and also took part in torpedo-bombings of the Allies ships in the Mediterranean and the bombing of Gibraltar.
A para-military force, the Guardia Nazionale Repubblicana, was formed 23 November 1943 from former members of the Carabinieri (military police), Polizia Africa Italiana (colonial police) and blackshirts units. These units were used for anti-partisan duties, often in cooperation with the SS, and were guilty of many warcrimes.

Mussolini was captured by partisans in Dongo when he attempted to flee and was shot, his body placed on public display in Piazza Loreto in Milan.
Many of the soldiers who had remained loyal were also murdered by the partisans after the end of the war, the lucky ones managed to the Allies who showed at lot more mercy that their fellow Italians.