Given the task definition and input, reply with output. In this task you will be given an answer to a question. You need to generate a question. The answer given should be a correct answer for the generated question.

The Battle of Appomattox Court House (Virginia, U.S.), fought on the morning of April 9, 1865, was one of the last battles of the American Civil War (1861-1865). It was the final engagement of Confederate States Army General-in-Chief, Robert E. Lee, and his Army of Northern Virginia before it surrendered to the Union Army / Army of the Potomac under the Commanding General of the United States, Ulysses S. Grant. Lee, having abandoned the Confederate capital of Richmond, Virginia, after the ten-month Siege of Petersburg and Richmond, retreated west, hoping to join his army with the remaining Confederate forces in North Carolina of the Army of Tennessee under Gen. Joseph E. Johnston. Union infantry and cavalry forces under Gen. Phillip Sheridan pursued and cut off the Confederates' retreat at the central Virginia village of Appomattox Court House. Lee launched a last-ditch attack to break through the Union forces to his front, assuming the Union force consisted entirely of lightly armed cavalry. When he realized that the cavalry was now backed up by two corps of Federal infantry, he had no choice but to surrender with his further avenue of retreat and escape now cut off.

where did the battle of appomattox take place