Spain ceded Florida to the United States via the Adams–Onís Treaty (signed 22 Feb 1819, ratified 1821), aka the Transcontinental Treaty. It settled borders, debts, and expansion ambitions in one diplomatic package.
Florida Territory organized 1822; statehood 1845. Treaty held until Mexican–American War (1846) redrew the western line again.
A textbook case of diplomacy swapping territory for certainty.