After the Wilderness Campaign (May-June, 1864), Ulysses S. Grant and the Army of the Potomac headed for the port of Petersburg on the Appomattox River. Robert E. Lee and the Confederate Army quickly retreated to Petersburg as it was considered vital to hold this town in order to protect Richmond. The Union Army suffered heavy losses at the end of July, 1864, trying to take the port but was eventually able to cut off Lee's supplies from the lower South.
In March, 1865, William Sherman joined Ulysses S. Grant and the main army at Petersburg. On 1st April Sherman attacked at Five Forks. The Confederates, led by Major General George Pickett, were overwhelmed and lost 5,200 men. On hearing the news, Robert E. Lee decided to abandon Richmond and join Joseph E. Johnston in South Carolina. Petersburg fell on 3rd April, 1865 and the Union Army entered Richmond later the same day.