The United States captured Guam from the Kingdom of Spain on 21 June 1898 during the Spanish–American War. The next year Spain sold the other islands in the Marianas chain to Germany. The United States Navy established a facility near the village of Piti on Guam in 1899, and the United States Marine Corps (USMC) opened a barracks at Sumay in 1901. A naval coaling station was established on the island in 1905, and a battery of six guns was emplaced to strengthen Guam's defenses in 1909. A U.S. Navy captain served as both the Governor and commander of the naval base from 1899 onwards, though there were some elements of a civilian government on the island.