The war greatly reduced the Spanish Empire. Spain had been declining as an imperial power since the early 19th century as a result of Napoleon's invasion. The loss of Cuba caused a national trauma because of the affinity of peninsular Spaniards with Cuba, which was seen as another province of Spain rather than as a colony. Spain retained only a handful of overseas holdings: Spanish West Africa (Spanish Sahara), Spanish Guinea, Spanish Morocco and the Canary Islands. With the loss of the Philippines, Spain's remaining Pacific possessions in the Caroline Islands and Mariana Islands became untenable and were sold to Germany in the German-Spanish Treaty (1899).