Spain was neutral in WW1 and WW2 but experienced a civil war (1936-1939) which killed over 500,000 people.
Spain was neutral in World War I. Following the war, wide swathes of Spanish society, including the armed forces, united in hopes of removing the corrupt central government, but were unsuccessful. Popular perception of communism as a major threat significantly increased during this period. In 1923 a military coup brought Miguel Primo de Rivera to power; as a result, Spain transitioned to government by military dictatorship. Support for the Rivera regime gradually faded, and he resigned in January 1930. He was replaced by General Dámaso Berenguer, who was in turn himself replaced by Admiral Juan Bautista Aznar-Cabañas; both men continued a policy of rule by decree. There was little support for the monarchy in the major cities. Consequently, King Alfonso XIII gave in to popular pressure for the establishment of a republic in 1931 and called municipal elections for 12 April of that year. The socialist and liberal republicans won almost all the provincial capitals, and following the resignation of Aznar's government, King Alfonso XIII fled the country. At this time, the Second Spanish Republic was formed. It remained in power until the culmination of the Spanish Civil War.