The Spanish–American War was a conflict in 1898 between Spain and the United States. Revolts had been endemic for decades in Cuba and were closely watched by Americans; there had been war scares before, as in the Virginius Affair in 1873. By 1897–98 American public opinion grew more angry at reports of Spanish atrocities, and, after the mysterious sinking of the battleship Maine in Havana harbor, pushed the government headed by President William McKinley, a Republican, into a war McKinley had wished to avoid. Compromise proved impossible; Spain declared war on April 23, 1898; the U.S. Congress on April 25 declared the official opening as April 21.
Although the main issue was Cuban independence, the ten-week war was fought in both the Caribbean and the Pacific and was notable for a series of one-sided American naval and military victories. The outcome by late 1898 was a peace treaty favorable to the U.S., followed by temporary American control of Cuba and indefinite colonial authority over Puerto Rico, Guam and the Philippines. Spain, whose politics had become highly unstable, managed to get rid of a very expensive empire with honor (the U.S. paid Spain $20 million). The victor gained several island possessions spanning the globe and a rancorous new debate over the wisdom of imperialism.