Attempts to re-assert control proved futile with opposition not only in the colonies but also in the Iberian peninsula and army revolts followed, led by liberal officers. By the end of 1826, the only American colonies Spain held were Cuba and Puerto Rico. The Napoleonic War left Spain economically ruined, deeply divided and politically unstable. In the 1830s and 1840s, Carlism (a reactionary legitimist movement supportive of an alternative Bourbon branch), fought against the government forces supportive of Queen Isabella II's dynastic rights in the Carlist Wars. Government forces prevailed, but the conflict between progressives and moderates ended in a weak early constitutional period. The 1868 Glorious Revolution was followed by the 1868–1874 progressive Sexenio Democrático (including the short-lived First Spanish Republic), which yielded to a stable monarchic period, the Restoration (1875–1931), a rigid bipartisan regime underpinned by the turnismo (the prearranged rotation of government control between liberals and conservatives) and the form of political representation at the countryside (based on clientelism) known as . In the late 19th century nationalist movements arose in the Philippines and Cuba. In 1895 and 1896 the Cuban War of Independence and the Philippine Revolution broke out and eventually the United States became involved. The Spanish–American War was fought in the spring of 1898 and resulted in Spain losing the last of its once vast colonial empire outside of North Africa. El Desastre (the Disaster), as the war became known in Spain, gave added impetus to the Generation of '98 who were analyzing the country. Although the period around the turn of the century was one of increasing prosperity, the 20th century brought little social peace; Spain played a minor part in the scramble for Africa, with the colonisation of Western Sahara, Spanish Morocco and Spanish Guinea. It remained neutral during World War I. The heavy losses suffered by the colonial troops in conflicts in northern Morocco against Riffians forces brought discredit to the government and undermined the monarchy. Industrialisation, the development of railways and incipient capitalism developed in several areas of the country, particularly in Barcelona, as well as Labour movement and socialist and anarchist ideas. The 1888 Barcelona Universal Exposition and the 1870 Barcelona Labour Congress are good examples of this. In 1879, the Spanish Socialist Workers' Party was founded. A trade union linked to this party, Unión General de Trabajadores, was founded in 1888. In the anarcho-sindicalist trend of the labour