The Battle of Appomattox Court House, fought on the morning of April 9, 1865, was the final engagement of Confederate States Army General Robert E. Lee's Army of Northern Virginia before it surrendered to the Union Army under Lt. Gen. Ulysses S. Grant, and one of the last battles of the American Civil War. Lee, having abandoned the Confederate capital of Richmond, Virginia, after the Siege of Petersburg, retreated west, hoping to join his army with the Confederate forces in North Carolina. Union forces pursued and cut off the Confederate retreat. Lee's final stand was at Appomattox Court House, where he launched an attack to break through the Union force to his front, assuming the Union force consisted entirely of cavalry. When he realized that the cavalry was backed up by two corps of Union infantry, he had no choice but to surrender.