Madrid therefore decided to cede the territory to the United States through the Adams-Onís Treaty, which took effect in 1821