All of the Spanish colonies, except Cuba and Puerto Rico, achieved independence by the 1820s. The British Empire extended support to America because they wanted to stop the Spanish monopoly on trade with its territories in America. The United States announced war on Spain after the U.S. warship collapsed and sank on February 15, 1898, while visiting Havana, Cuba. In 1898, the United States was helped in the war by the British Empire to protect its residents and companies in Cuba. However, the United States attained success in the Spanish–American War with Spain, dismissing the Spanish colonial era. This war was known as the Spanish-American War.