 The last Confederate surrender occurred on November 6, 1865, when the Confederate warship CSS "Shenandoah" surrendered at Liverpool, England.President Johnson formally declared the end of the war on August 20, 1866.General Robert E. Lee commanded the Army of Northern Virginia, while Major General John Brown Gordon commanded its Second Corps.