In 1898, the U.S. intervened in support of Cuba during its war for independence from Spain. The U.S. won what is known in the U.S. as the Spanish–American War and in Cuba as the Cuban War for Independence. Under the terms of the peace treaty from which Cuba was excluded, Spain ceded Puerto Rico, the Philippines, and Guam to the U.S. in exchange for $20 million. Cuba came under U.S. control and remained so until it was granted formal independence in 1902.