After his astounding victory at the Battle of Chancellorsville, Virginia, in May 1863, Robert E. Lee led his Army of Northern Virginia in its second invasion of the North—the Gettysburg Campaign. With his army in high spirits, Lee intended to collect supplies in the abundant Pennsylvania farmland and take the fighting away from war-ravaged Virginia. He wanted to threaten Northern cities, weaken the North's appetite for war and, especially, win a major battle on Northern soil and strengthen the peace movement in the North. Prodded by President Abraham Lincoln, Maj. Gen. Joseph Hooker moved his Union Army of the Potomac in pursuit, but was relieved of command just three days before the battle. Hooker's successor, Maj. Gen. George Gordon Meade moved northward, keeping his army between Lee and Washington, D.C. When Lee learned that Meade was in Pennsylvania, Lee concentrated his army around Gettysburg.
Elements of the two armies collided west and north of the town on July 1, 1863. Union cavalry under Brig. Gen. John Buford slowed the Confederate advance until Union infantry, the Union 1st and 11th Corps, arrived. More Confederate reinforcements under generals A.P. Hill and Richard Ewell reached the scene, however, and 30,000 Confederates ultimately defeated 20,000 Yankees, who fell back through Gettysburg to the hills south of town--Cemetery Hill and Culp's Hill.
On the second day of battle, the Union defended a fishhook-shaped range of hills and ridges south of Gettysburg with around 90,000 soldiers. Confederates essentially wrapped around the Union position with 70,000 soldiers. On the afternoon of July 2, Lee launched a heavy assault on the Union left flank, and fierce fighting raged at Devil's Den, Little Round Top, the Wheatfield, the Peach Orchard and Cemetery Ridge. On the Union right, demonstrations escalated into full-scale assaults on Culp's Hill and East Cemetery Hill. Although the Confederates gained ground, the Union defenders still held strong positions by the end of the day.
On July 3, fighting resumed on Culp's Hill, and cavalry battles raged to the east and south, but the main event was a dramatic infantry assault by 12,000 Confederates against the center of the Union line on Cemetery Ridge--Pickett's Charge. The charge was repulsed by Union rifle and artillery fire, at great losses to the Confederate army. Lee led his army on a torturous retreat back to Virginia. As many as 51,000 soldiers from both armies were killed, wounded, captured or missing in the three-day battle. Four months after the battle, President Lincoln used the dedication ceremony for Gettysburg's Soldiers National Cemetery to honor the fallen Union soldiers and redefine the purpose of the war in his historic Gettysburg Address.