Spain faced a sequence of challenges across her colonies in the second half of the century that would result in a total defeat of empire at the hands of the growing power of the United States. Spain's colony of Cuba rebelled in 1868, leading to a sequence of brutal guerrilla insurgencies and retaliations, through the Ten Years' War (1868–1878), the Little War (1879–1880) and finally the Cuban War of Independence (1895–1898). Spain, although militarily occupied with the Carlist troubles at home, put increasing resources into the conflict, slowly taking the upper hand, and assisted by American sales of modern weaponry. By 1898, however, increasing U.S. political interests in Cuba were encouraging a more interventionist policy. The sinking of the USS "Maine" in Havana harbour provided the trigger for the Spanish–American War, in which Spain's aging navy fared disastrously. Cuba gained its independence and Spain lost its remaining New World colony, Puerto Rico, which together with Guam and the Philippines it ceded to the United States for 20 million dollars. In 1899, Spain sold its remaining Pacific islands – the Northern Mariana Islands, Caroline Islands and Palau – to Germany, reducing Spain's colonial possessions to Spanish Morocco, the Spanish Sahara and Spanish Guinea, all in Africa.