In 1868, Cuba launched a war of independence against Spain. On that island, as had been the case in Santo Domingo, the Spanish government found itself embroiled in a difficult campaign against an indigenous rebellion. Unlike in Santo Domingo, however, Spain would initially win this struggle, having learned the lessons of guerrilla warfare well enough to defeat this rebellion. The pacification of the island was temporary, however, as the conflict revived in 1895 and ended in defeat at the hands of the United States in the Spanish–American War of 1898. Cuba gained its independence and Spain lost its remaining New World colony, Puerto Rico, which together with Guam and the Philippines were 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 and Spanish colonial possessions were reduced to Spanish Morocco, Spanish Sahara and Spanish Guinea, all in Africa.