The Confederate States of America (CSA) was a short-lived government that existed in the southern United States during the American Civil War. It was established in 1861 by seven southern states in which slavery was legal, after Abraham Lincoln was elected president of the U.S., but before he took office. South Carolina, Mississippi, Florida, Alabama, Georgia, Louisiana, and Texas declared their secession (independence) from the United States. After war began, Virginia, Arkansas, Tennessee, and North Carolina joined them. The first capital of the Confederacy was Montgomery, Alabama, but for most of the war the capital was Richmond, Virginia.