Spain ceded Florida to the United States with the Adams-Onís Treaty, which was signed in 1819 but took effect in 1821. At the time, Spain was struggling with a lot of political and revolutionary problems in its many colonies in the New World, and believed that granting Florida to the Americans was in Spain's best interest.