Although the period around the turn of the century was one of increasing prosperity, the 20th century brought little social peace; Spain played a minor part in the scramble for Africa, with the colonisation of Western Sahara, Spanish Morocco and Equatorial Guinea. It remained neutral during World War I. The heavy losses suffered during the Rif War in Morocco brought discredit to the government and undermined the monarchy.