The territory was disputed for years between Spain and the United States after France had ceded Louisiana to the American government as part of the Louisiana Purchase of 1803. It was definitively acquired by the United States from Spain with the Adams-Onis Treaty in 1819. The treaty was formally ratified on February 22, 1821. By an act of Congress, approved on March 3, 1823, this strip of land was attached to the district of the Louisiana Territory south of the Red River.