In 1915, the United States became interested in buying the U.S. Virgin Islands. They were concerned over German infiltration in the Lesser Antilles. The U.S. purchased the Danish West Indies in 1917 for $25 million. Charlotte Amalie was under U.S. Navy rule until 1931. The United States decided to make Charlotte Amalie the main headquarters of the renamed United States Virgin Islands. During the Second World War, the city became a naval base to protect allied shipping to and from the Panama Canal.