How did Florida become apart of the us?

Florida used to be owned by Spain until 1819. Before 1819 however, it's been a land of freedom. Seminole Indians and runaway slaves lived there for protection from the United States. The Indians would raid Georgia and retreat back to Florida, the U.S. being powerless to stop the raids. If they did attack, they would wage war with Spain. After a while, the United States threatened to take care of the situation if Spain won't. They would march into Florida and take it over. Spain ceded it over in the Adams-Onis Treaty because they were going to lose it anyway and they were able to clear up other misunderstandings in the Louisiana Purchase.