The end of the Spanish neutrality
From 1914 to 1916 the Spanish government, first under the conservative Eduardo Dato e Iradier and then under the liberal Álvaro Figueroa y Torres Mendieta, earl of Romanones, maintained a stance of benevolent neutrality, that, depending on the inclinations of the Presidente del Consejo de Ministros (1), helped one or another belligerent side. To this fact we must add the actions of the highly divided Spanish public opinión and the guidelines of Alfonso XIII. However, due to the attacks of submarines against Spanish merchant ships, the Spanish government became more and more inclined to join the Enente side, as we shall see.
The then Spanish prime minister, Eduardo Dato, declared neutrality the same day the war in Europe began. For this he was applauded in the Cortes (2) when they reconvened on 30 October. The division of the Spanish public opinion between Alliadophile (the middle and professional classes and intellectuals, plus a few young military officers) and Germanophile (made up by the upper classes, the Catholic Church and the Spanish Army), the lack of importance of Spain in the strategic theatre of war, the awful situation of the Spanish economy (still struggling from the consequences of the loss of the colonial empire in 1898) and the pitiful state of the Spanish Armed Forces helped to keep this neutral stance.
Politically speaking, the country was also divided. A faction of the conservative party, the so-called Mauristas (3), and the radical reactionary Carlists favoured the Germans. The Pro-Entente side was made up by Socialists, Republicans, Catalan nationalists and part of the Liberal party. As early as August 1914, some Catalans were volunteering in the French Army and joined the Foreign Legion. Over 2,000 Spaniards were to join the Legion, the majority of them Catalans, followed by a great number of Basque and Aragonese volunteers.
As soon as it became obvious (from 1915 onwards) that the war was going to be a long one, the value of Spain for both sides grew out of any proportion as both the Entente and the Central Powers were looking for new sources of raw materials, and also because the spy game that both sides developed in Spain.
The diplomatic situation began to turn against the Central Powers when, on December 9th, 1915, the earl of Romamones, a well known sympathizer of the Entente, became the President of the Council of Ministers. Even if Miguel de Villanueva, who favoured the Central Powers, was named Foreign Minister, Berlin was quite worried by this, and even more since February 1916, when de Villanueva became Minister of the Treasury and the Foreign Ministry went to Romanones. The German ambassador in Madrid, Max von Ratibor, became more and more worried about it, as its messages to Berlin proved. To make it worse, the German submarine offensive soon affected Spain and to further damage the diplomatic relations between Madrid and Berlin. The first Spanish merchant ship (4), the Isidoro, was sunk by the German submarine U-38 on August 17th, 1915.
Thus, on March 16, 1916 the former German Ambassador in Lisbon, Friedrich Rosen, met Alfonso XIII to try to appease the Spanish government through the king, but without any success. To make it worse, Alfonso XIII, who was married with Victoria Eugenia, a grand daughter of Queen Victoria, had a strong dislike for von Ratibor, and the more reliable reports came from a cousin of the king, Alfonso María de Borbón; the Spanish Ambasador in Berlin, Luis Polo de Bernabé (5) and the Spanish Minister in Brussels, Rodrigo de Saavedra y Vinent, marquis of Villalobar, who was a close friend of the German representative at Brussels, baron von der Lacken.
By the end of September 1916, Spain was suffering from a lack of coal for its economy caused by the German submarine blockade. To make it worse, sixteen Spanish merchant ships were sunk in four months (November 1916 - February 1917), making the situation of the Spanish economy a bit even harder (6), and Romanones, after all his complaints to Berlin were ignored, began to negotiatie with London and Paris at the end of December 1916 and to press the Cortes for a declaration of war against the Central Powers. Finally, on March 1st, 1917, Spain joined the Triple Entente.
(1) President of the Council of Ministers, that is, the prime minister.
(2) The Spanish Parliament
(3) The followers of the conservative leader Antonio Maura, who, ironically, was in favour of closer ties with the Entente because of Spain's 1907 pact with Britain and France, which was designed to head off German colonialism in north Africa.
(4) The first of 87 ships that were sunk during the conflict (both in OTL and in this TL).
(5) Polo, along twith the Spanish militar attaché, Major Valdivia, worked more in OTL as the personal representatives of the German Foreign Secretary than for his king and country.
(6) In OTL 1916, the German submarines sunk 80,000 tons of Spanish shipping.