France ceded what now is Alabama to the British in 1763. Twenty years later, most of it became part of the United States. Land around Mobile had been taken by the Spanish during the American Revolution, and it was captured by the United States in 1813 during the War of 1812. Also during the War of 1812, Andrew Jackson broke the power of the Creek Indians. Over the next 25 years, nearly all of the Alabama Indians were removed to the western United States. Organized as a territory in 1817, Alabama was admitted to the Union as the 22nd state on December 14, 1819. Huntsville was its first capital.