The European powers recognized the islands as part of the Spanish East Indies in 1874. However, Spain sold the islands to the German Empire in 1884, and they became part of German New Guinea in 1885. In World War I the Empire of Japan occupied the Marshall Islands, which in 1919 the League of Nations combined with other former German territories to form the South Pacific Mandate. In World War II, the United States conquered the islands in the Gilbert and Marshall Islands campaign. Along with other Pacific Islands, the Marshall Islands were then consolidated into the Trust Territory of the Pacific Islands governed by the US. Self-government was achieved in 1979, and full sovereignty in 1986, under a Compact of Free Association with the United States. Marshall Islands has been a United Nations member state since 1991.