defeated Confederate soldiers were paroled at Appomattox, after which they walked home (and caught trains wherever possible)
Source: National Park Service, The Appomattox Campaign
The siege of Petersburg was the longest military event of the Civil War, lasting over nine months. When Confederate forces could no longer defend Petersburg, they fled west. A week later, they were surrounded at Appomattox Court House. General Robert E. Lee then surrendered the Army of Northern Virginia to General Ulysses S. Grant. Other Confederate military forces soon surrendered as well, ending the fighting of the Civil War.
In the summer of 1864 Richmond, not Petersburg, had been the target of Grant's Overland Campaign. The Union Army could not breach the fortifications at Cold Harbor east of Richmond, however, so General Grant tried to outflank them.
He sent his forces across the James River in an attempt to capture Petersburg in a swift strike. Capturing Petersburg would cut the Richmond and Petersburg Railroad, which brought most supplies north from Confederate-controlled territory to Richmond. The Richmond and Danville Railroad and the James River and Kanawha Canal would not be able to provide enough supplies to Richmond, and General Grant expected that the Confederate capital would fall to the Union Army soon after Petersburg.
The Union attack on Petersburg in June, 1864 was not swift. Confederates were able to erect a new line of fortifications on June 18 and move troops into them. The Union Army had trapped the Confederate Army inside the Petersburg fortifications, but the siege continued because the Confederates blocked all efforts to cut through the defense line. Union forces created a massive supply depot at City Point, and extended siege lines westward to cut off Confederate supplies. The Union Army's capture of the Norfolk and Petersburg Railroad and the Petersburg (Weldon) Railroad left only the South Side Railroad as a Confederate supply line.
On April 1, the Union infantry and cavalry broke through at Five Forks west of Petersburg. The east-west road at that Dinwiddie County crossroads was White Oak (Butterwood) Road. The north-south road was Church (Ford) Road, which ran from Dinwiddie Court House north through Five Forks to Hatcher's Run Church and the South Side Railroad north of Hatcher's Run. The fifth fork was Scott's Road, heading southwest.1
the Union Army capture of Five Forks on April 1, 1865 led to the evacuation of Petersburg, after nine months of siege warfare
Source: Library of Congress, Map of Dinwiddie County, Va (1864)
Five Forks was the far right flank of the Confederate defense line. When the Confederates were defeated there, it was clear that the Union Army would cut the South Side Railroad. Without it, the Confederate Army inside the Petersburg fortifications would run out of supplies and be forced to surrender.
General Grant ordered a general offensive against the Petersburg fortifications on April 2. Union troops broke through at what today is Pamplin Historical Park & The National Museum of the Civil War Soldier, and were poised to capture the Confederate army if it did not retreat. General Robert E. Lee evacuated the Confederate defense line throughout the night of April 2-3, while top Confederate officials fled Richmond using trains on the Richmond and Danville Railroad. Union forces took control of the Southside Railroad Depot in downtown Petersburg on the morning of April 3.
Lee had multiple columns march towards a planned combination at Amelia Court House. At the Richmond and Danville Railroad depot there, Lee expected to find food brought on railcars from Richmond.1
Confederate forces evacuated Richmond and Petersburg on the night of April 2, planning to meet at Amelia Court House
Source: National Park Service, The Appomattox Campaign, April 2-9, 1865
Lee's retreat ended up being only seven days long. No rations had been sent to Amelia Court House, so he paused there for a day in hopes of gathering food from the local area. That delay allowed Union Army cavalry and infantry to catch up. When Lee sought to march southwest along the Richmond and Danville Railroad, they were blocked at Jetersville.
For the Confederates, the next source of rations was at Farmville on the South Side Railroad. They marched to that depot, while the Union forces sought to attack them constantly. At Sailor's Creek, west of Jetersville, one-quarter of the Confederate Army and much of its wagon train was captured on April 6.
There were rations waiting at Farmville, but the Union Army arrived soon after the Confederates. Efforts to destroy the High Bridge of the South Side Railroad over the Appomattox River had not succeeded, and Union forces advanced across the river using a low wagon bridge the Confederates had left intact.2
Union forces blocked Lee's efforts to move to Danville, and finally surrounded the Army of Northern Virginia at Appomattox
Source: National Park Service, The Appomattox Campaign, April 2-9, 1865
General Robert E. Lee surrendered the Army of Northern Virginia formally on April 9, 1865 to General Ulysses S. Grant. That event occurred in the parlor of Wilmer McLean's house in Appomattox Court House.
McLean had moved to Appomattox Court House in 1863. His farmhouse Yorkshire near Manassas was used by General P.G.T. Beauregard as Confederate headquarters in July 1861, and then the area was exposed to more fighting in August 1862 in the Second Manassas battle. McLean stayed in business supplying sugar to the Confederate forces from his new house on the Lynchburg-Richmond State Road, near the South Side Railroad.3
Petersburg evolved into the key supply center for the Confederate Army of Northern Virginia after Union General Grant's 1864 Overland Campaign concluded with a siege of Richmond. Railroads and plank roads connected Petersburg to North Carolina and points south, from which came food, military equipment, and other resources to maintain General Lee's army in the trenches around Richmond. The Richmond and Petersburg Railroad carried supplies north from the concentration point at Petersburg to Richmond.
General Grant finally cut the supply line at Petersburg in April 1865, and that forced the Confederate Army to evacuate Richmond
Source: Library of Congress, Central Virginia: showing Lieut. Gen'l. U.S. Grant's campaign and marches of the armies under his command in 1864-5 (US War Department. Engineer Bureau, between 1864 and 1869)
Confederate fortifications around Petersburg prevented capture by the Union Army until April 2, 1865
Source: HathiTrust, Harper's Weekly, Capture of Rebel Fort In Front of Petersburg By the One Hundred and Forty-Eighth Pennsylvania (November 19, 1864, p.741)
Robert E. Lee and his officers signed paroles printed by the Union Army for the surrender of the Army of Northern Virginia
Source: National Archives, American Originals: Civil War and Reconstruction (1850-1877)
the day after the surrender at Appomattox, terms for subsequent action authorized Confederate officers to retain their sidearms and private horses
Source: National Archives, Articles of Agreement in Regard to the Surrender of the Army of Northern Virginia Under General Robert E. Lee
in August 1865, Wilmer McLean and his family posed on the porch of their house where General Lee surrendered to General Grant
Source: National Park Service, McLean House - 1865
in 1949, the National Park Service reconstructed the McLean House at Appomattox Court House National Historical Park
Source: National Park Service, The McLean House Today