The main Confederate armies, the Army of Northern Virginia under General Robert E. Lee and the remnants of the Army of Tennessee and various other units under General Joseph E. Johnston, surrendered on April 9, 1865 (officially April 12), and April 18, 1865 (officially April 26).