The United States acquired Florida from Spain through the Adams–Onís Treaty of 1819 (ratified 1821). The purchase price was $5 million, paid not in cash but through the assumption of U.S. citizens' claims against Spain.
This acquisition completed the U.S. southeastern border and paved the way for Florida's eventual statehood in 1845.