Treaty, negotiated in 1819 and ratified in 1821, ceded Florida and St. Augustine, still its capital at the time, to the United States. Territory of Florida According to the Adams–Onís Treaty, the United States acquired East Florida and absolved Spain of $5 million of debt. Spain renounced all claims to West Florida and the Oregon Country. Andrew Jackson returned to Florida in 1821, upon ratification of the treaty, and established a new territorial government. Americans from older plantation societies of Virginia, Georgia, and the Carolinas began to move to the area. West Florida was quickly consolidated with East and the new capital of Florida became Tallahassee, halfway between the old capitals of St. Augustine and Pensacola, in 1824. Once many Americans had begun to immigrate to the new territory, it became apparent that there would be continued skirmishes with local Creek and Miccosukee peoples and white settlers encroaching on their land. The United States government favored removal policies, but local indigenous groups in Florida refused to leave without fighting. The nineteenth century saw three Seminole Wars. In 1823, territorial governor William Duval and James Gadsden signed the Treaty of Moultrie Creek, forcing Seminoles onto a four million acre reservation in central Florida. The Second Seminole War (1835–1842) was the longest war of Indian removal and resulted when the United States government attempted to move the Seminole people from Central Florida to a Creek reservation west of the Mississippi River. As a result of the Seminole War, Seminole prisoners, including the prominent leader Osceola, were held captive in the Castillo de San Marcos, renamed Fort Marion after General Francis Marion, who fought in the American Revolution, in the 1830s. By 1840, the territory's population had reached 54,477 people. Half the population were enslaved Africans. Steamboats were popular on the Apalachicola and St. Johns River and there were several plans for railroad construction. The territory south of present-day Gainesville was sparsely populated by whites. In 1845 the Florida Territory was admitted into the Union as the State of Florida. Civil War On January 7, 1861, only three days before Florida would secede and join the Confederacy, a group of 125 Florida militia marched on Fort Marion. The fort was guarded by a single sergeant, who surrendered the fort after being provided with a receipt. Gen. Robert E. Lee, who was commander of coastal defenses at the time, ordered that the fort's cannons