The participation of Italy in the Second World War was characterized by a complex framework of ideology, politics, and diplomacy, while its military actions were often heavily influenced by external factors. Italy joined the war as one of the Axis Powers in 1940, as the French Third Republic surrendered, with a plan to concentrate Italian forces on a major offensive against the British Empire in Africa and the Middle East, known as the "parallel war", while expecting the collapse of British forces in the European theatre. The Italians bombed Mandatory Palestine, invaded Egypt and occupied British Somaliland with initial success. However the war carried on and German and Japanese actions in 1941 led to the entry of the Soviet Union and United States, respectively, into the war, thus foiling the Italian plan of forcing Britain to agree to a negotiated peace settlement.
The Italian dictator Benito Mussolini was aware that Fascist Italy was not ready for a long conflict, as its resources were reduced by successful but costly pre-WWII conflicts: the pacification of Libya (which was undergoing Italian settlement), intervention in Spain (where a friendly fascist regime had been installed), and the invasion of Ethiopia and Albania. However, he opted to remain in the war as the imperial ambitions of the Fascist regime, which aspired to restore the Roman Empire in the Mediterranean (the Mare Nostrum), were partially met by late 1942. By this point, Italian influence extended throughout the Mediterranean.
With the Axis invasion of Yugoslavia and the Balkans, Italy annexed Ljubljana, Dalmatia and Montenegro, and established the puppet states of Croatia and Greece. Following Vichy France's collapse and the Case Anton, Italy occupied the French territories of Corsica and Tunisia. Italian forces had also achieved victories against insurgents in Yugoslavia and in Montenegro, and Italo-German forces had occupied parts of British-held Egypt on their push to El-Alamein after their victory at Gazala.
However, Italy's conquests were always heavily contested, both by various insurgencies (most prominently the Greek resistance and Yugoslav partisans) and Allied military forces, which waged the Battle of the Mediterranean throughout and beyond Italy's participation. The country's imperial overstretch (opening multiple fronts in Africa, the Balkans, Eastern Europe, and the Mediterranean) ultimately resulted in its defeat in the war, as the Italian empire collapsed after disastrous defeats in the Eastern European and North African campaigns. In July 1943, following the Allied invasion of Sicily, Mussolini was arrested by order of King Victor Emmanuel III, provoking a civil war. Italy's military outside of the Italian peninsula collapsed, its occupied and annexed territories falling under German control. Under Mussolini's successor Pietro Badoglio, Italy capitulated to the Allies on 3 September 1943, although Mussolini would be rescued from captivity a week later by German forces without meeting resistance. On 13 October 1943, the Kingdom of Italy officially joined the Allied Powers and declared war on its former Axis partner Germany.
The northern half of the country was occupied by the Germans with the cooperation of Italian fascists, and became a collaborationist puppet state (with more than 800,000 soldiers, police, and militia recruited for the Axis), while the south was officially controlled by monarchist forces, which fought for the Allied cause as the Italian Co-Belligerent Army (at its height numbering more than 50,000 men), as well as around 350,000 Italian resistance movement partisans (many of them ex-Royal Italian Army soldiers) of disparate political ideologies that operated all over Italy. On 28 April 1945, Mussolini was assassinated by Italian partisans at Giulino, two days before Hitler's suicide.