On 31 December 1916 during the Great War, the German U-boat, SM U-38, captained by Max Valentiner, entered Funchal harbour on Madeira; it torpedoed and sank three ships: CS Dacia (1,856 tons), SS Kanguroo (2,493 tons) and Surprise (680 tons), bringing the war to Portugal by extension. The commander of the French gunboat Surprise and 34 of her crew (including 7 Portuguese) died in the attack. TheDacia, a British cable-laying vessel, had previously undertaken war work off the coast of Casablanca and Dakar. It was in the process of diverting the German South American cable into Brest, France. Following the attack on the ships, the Germans proceeded to bombard Funchal for two hours from a range of about 2 miles (3 km). Batteries on Madeira returned fire and eventually forced the Germans to withdraw.
On 12 December 1917, 2 German U-boats, SM U-156 and SM U-157 (captained by Max Valentiner) again bombarded Funchal. This time the attack lasted around 30 minutes. Forty, 4.7-and-5.9-inch (120 and 150 mm) shells were fired. There were 3 fatalities and 17 wounded; a number of houses and Santa Clara church were hit.
Charles I, the last Emperor of the Austro-Hungarian Empire, went into exile in Madeira, after his second unsuccessful coup d’état in Hungary. He died there on 1 April 1922 and is buried in Monte. Charles had tried in 1917 to secretly enter into peace negotiations with France. Although his foreign minister, Ottokar Czernin, was interested only in negotiating a general peace to include Germany, Charles independently pursued a separate peace. He negotiated with the French using his brother-in-law, Prince Sixtus of Bourbon-Parma, an officer in the Belgian Army, as intermediary. When news of the overture leaked in April 1918, Charles denied involvement until the French Prime Minister Georges Clemenceau published letters signed by him. Czernin resigned and Austria-Hungary became more dependent in relation to its seemingly wronged German ally. Determined to prevent an attempt to restore Charles to the throne, the Council of Allied Powers agreed he could go into exile on Madeira because it was isolated in the Atlantic and easily guarded.