Louisiana was inhabited by Native Americans when European explorers arrived in the 17th century. Settlement and colonization began in the 18th century. In 1800, France's Napoleon Bonaparte acquired Louisiana from Spain in the Treaty of San Ildefonso, an arrangement kept secret for some two years.
Then in 1803, Bonaparte sold the territory to the United States, which divided it into two territories: the Orleans Territory (which became the state of Louisiana in 1812) and the District of Louisiana (which consisted of all the land not included in Orleans Territory). The Florida Parishes were annexed from Spanish West Florida by proclamation of President James Madison in 1810. The western boundary of Louisiana with Spanish Texas remained in dispute until the Adams-Onís Treaty in 1819, with the Sabine Free State serving as a neutral buffer zone as well as a haven for criminals.
Louisiana was a slave state. It also had one of the largest free black populations in the United States.(see slavery) In the American Civil War, Louisiana seceded from the Union on January 26, 1861. New Orleans was captured by Federal troops on April 25, 1862. Because a large part of the population had Union sympathies (or compatible commercial interests), the Federal government took the unusual step of designating the areas of Louisiana under federal control as a state within the Union, with its own elected representatives to the U.S. Congress.