Weakened from its defeat in the Spanish–American War, Spain could no longer effectively control and protect the nearly 6,000 islands it retained throughout Micronesia, including the Northern Marianas, Carolines and Pelew Islands. Therefore, Spain entered into the German-Spanish Treaty of February 12, 1899 to sell the Northern Marianas and its other remaining islands to Germany for 837,500 German gold marks (about $4,100,000 at the time). The Northern Marianas and other island groups were incorporated by Germany as a small part of the larger German Protectorate of New Guinea. The total population in the Northern Marianas portion of these islands was only 2,646 inhabitants around this time, with the ten most northerly islands being actively volcanic and thus mostly uninhabited.