Spanish-American War Cuba began struggling for independence against Spain in 1895, and the colonial power's brutal repression of the revolution earned the Cubans widespread American sympathy. The unexplained sinking of the American battleship Maine in the harbor off Havana increased the support of the public and Congress for a war against Spain. In 1898, the two countries declared war on one another. The conflict lasted just three months, and took place on the seas around Cuba and in the Pacific, where an American naval fleet took the Philippine Islands, a Spanish colony. The US also gained the former Spanish possessions of Puerto Rico and Guam. While officially, Cuba was an independent nation after the war, U.S. troops occupied the island for four years and the American government kept a watchful eye on the Cuban political situation. The US further increased its territory in the Pacific by annexing the country of Hawaii in a separate action during the war.