The two colonies that did not achieve independence between 1808 and 1826 were Cuba and Puerto Rico. Cuba remained a Spanish colony until 1898, when it came under temporary U.S. control before gaining independence in 1902. Puerto Rico remained a Spanish colony until 1898, when it became a territory of the United States following the Spanish-American War.