The Confederacy, officially known as the Confederate States of America (CSA), lasted from 1861 to 1865. It was formed by eleven Southern states that seceded from the United States following Abraham Lincoln's election in 1860, with the provisional government established in February 1861
. The Civil War began in April 1861 with the Confederate attack on Fort Sumter, and the Confederacy existed as a separate government until its defeat in the spring of 1865. The Confederate government effectively dissolved by March 1865, with the last significant military surrender occurring in May 1865. The final Confederate military unit surrendered as late as November 1865, marking the complete end of the Confederacy's existence
. In summary, the Confederacy lasted approximately four years, from early 1861 until its collapse in 1865.