Alfonso XIII in uniform, displaying the badges of the
Order of Santiago and
Laureate Cross of Saint Ferdinand. Oil on canvas by Víctor Morelli Sánchez-Gil (1910),
Museo del Prado,
Madrid, Spain. The
new reign was initially popular with the subjects of
el rey niño ("the child-king"), and a
Le Figaro article described
Alfonso XIII in 1889 as "the happiest and best-loved of all the rulers on Earth". However,
wars of national liberation fought by
anti-imperialist revolutionaries in the
Caribbean (
Cuba and
Puerto Rico) and
Pacific Ocean (
Guam and
the Philippines) against the
Spanish Empire (1833–1898) continued to drain resources, and domestic discontent meant that
Antonio Cánovas del Castillo, architect of the
turnismo political system, was assassinated by a
Spanish anarchist in 1897. Eventually, the
Spanish–American War led to the loss of Spain's last major
overseas colonies in 1898. This rapid collapse devastated Spain and damaged the credibility of the government and its associated ideologies. It also nearly caused a military coup d'état led by General
Camilo García de Polavieja. This event marked the beginning of the country's political and economic decline, giving rise to numerous conflicting opposition movements at local and national levels. Alfonso XIII came of age in May 1902 and was crowned on 17 May 1902, ending the regency of the Queen Mother. Spain began her international rehabilitation by selling her remaining colonial possessions to the
German Empire in 1899, and being awarded the mainland of
Spanish Guinea, the
Río Muni, in a common agreement with
Republican France in 1900. This took off after the
Algeciras Conference of 1906. Spain was accorded by common consent of the
European Great Powers against the sabre rattling foreign policy of
Kaiser Wilhelm II, a
Spanish sphere of influence in northern Morocco that became a formal protectorate in 1912 by the
Treaty of Fez, giving the Spanish military a new outlet after the loss of 1898 to expend itself upon and thus was born the
"Africanist" ideology, which Alfonso became a leading supporter of up until his abdication. In 1907, it signed the
Pact of Cartagena with France and
Great Britain, a defensive alliance against the
Triple Alliance. The Spanish government was able to begin rebuilding its fleet and built the
España-class battleship and the
Reina Victoria Eugenia-class battleship. The last was named after Alfonso's new British wife,
Victoria Eugenia of Battenberg (nicknamed Ena), granddaughter of
Queen Victoria. Their marriage produced two haemophiliac sons, however, and Alfonso never forgave his wife, starting numerous affairs with other women. In 1909,
failed attempts to conquer Morocco led to domestic discontent, culminating in a revolt known as the
Semana Tragica in
Barcelona,
Catalonia. The rebellion, led mainly by lower-class citizens and supported by
anarchists,
communists, and
republicans, was a response to what they saw as unfair practices in recruiting soldiers. The government declared a state of war and sent in troops to put down the uprising, which resulted in more than a hundred deaths and the execution of the anarchist educator
Francisco Ferrer. The socialist
Unión General de Trabajadores (UGT) and the anarchist
Confederación Nacional del Trabajo (CNT) attempted to organize a national general strike, but the unions were only able to mobilize urban workers. When
World War I broke out in 1914,
Spain remained neutral; as a result, its economic and industrial growth largely derived from exporting arms to
the Entente from the armaments sector in towns like
Eibar,
Basque Country, located nearby the
Spanish–French border. Spain profited too by diplomatically taking over the consulates of warring nations and acting as an intermediary. Notwithstanding a brief war scare when the German high command resumed to
unrestricted submarine warfare in Spring 1917, which saw the
United States enter the war (April 1917) and Spain nearly do the same, Alfonso XIII offered to mediate peace on several instances, offered the dispossessed
Romanov family shelter in Spain after the
Bolshevik Revolution (October 1917), established in the
Royal Palace of Madrid an office for finding lost relatives that earned him a
Nobel Peace Prize recommendation, and the
Spanish Consul in Jerusalem, Antonio de Ballobar, negotiated the
handover of the Holy City to the British forces led by General Sir
Edmund Allenby (December 1917). The
left-wing strikes of 1917–1918 and the
economic bubble's bursting after the end of the war left Spain rocked by
financial crisis, while the
1918–1920 flu pandemic resulted in the death of 200,000
Spaniards (1% of the population). The King and the conservatives shifted increasingly in reaction away from stability in
turnismo after the entry of
radical republicans and
far-left groups into the
Cortes Generales, such as the creation of the
Spanish Communist Party (1920–1921), and became more and more
authoritarian. In 1921, conflict in
Spanish-ruled Morocco escalated, beginning the
Rif War (1920–1926). A group of Moroccan militants from the
Republic of the Rif launched a surprise attack on the
Army of Spanish Morocco. Led by the Moroccan chieftain
Abd el-Krim, a coalition of
Riffians and
Jebala nearly annihilated the Spanish forces numbering some 10,000-13,000 men and pushed them back toward
Melilla in the
battle of Annual. The top military officers were blamed for the Spanish defeat due to poor planning. This led to lowered morale among the military, who felt misunderstood as they were ordered to advance inland without adequate resources to occupy the difficult terrain. A parliamentary inquiry was launched, and the purported role of the King in insisting on advance even in spite of advice to the contrary was seized upon by the
Republican Party as proof of his incompetence as late as 1931. Prime Minister
Eduardo Dato was assassinated by motorcycle-riding gunmen in March as well, the third such minister to be so killed in three decades, and Spain reeled from one crisis after another crisis. ==Dictatorship of Primo de Rivera (1923–1930)==