In 1898, the U.S. intervened in support of Cuba during its war for independence from Spain. The resulting Spanish–American War ended in a peace treaty requiring Spain to cede Puerto Rico, the Philippines, and Guam to the U.S. in exchange for $20 million. Spain was additionally forced to recognize Cuban independence, though the island remained under U.S. occupation until 1902.