After Guam was ceded by Spain to the United States in the Spanish–American War of 1898, 'Agana' remained the seat of government under U.S. Naval Administration. By 1940, the city's population had grown to about 10,000 containing nearly half of the island's residents. Villages had been established nearby for immigrants from the Caroline Islands.