The American Civil War lasted a little over four years, beginning on April 12, 1861, with the Confederate attack on Fort Sumter in South Carolina, and effectively ending on April 9, 1865, when Confederate General Robert E. Lee surrendered to Union General Ulysses S. Grant at Appomattox Court House, Virginia
. Although Lee's surrender marked the collapse of the main Confederate army, other Confederate forces continued to surrender in the following months, with the last significant surrender occurring on May 26, 1865
. The formal end of the Civil War is sometimes noted as August 20, 1866, when the final Confederate forces officially surrendered, but the major combat operations had ceased by mid-1865
. In summary, the war spanned from April 1861 to at least April 1865, lasting about four years, with some residual surrenders extending into 1865 and formal closure in 1866.