The Battle of Gettysburg (July 1–3, 1863), fought in and around the town of Gettysburg, Pennsylvania, as part of the Gettysburg Campaign, was the battle with the largest number of casualties in the American Civil War and is often described as the war's turning point. Union Maj. Gen. George Gordon Meade's Army of the Potomac defeated attacks by Confederate Gen. Robert E. Lee's Army of Northern Virginia, ending Lee's invasion of the North.
After his success at Chancellorsville in May 1863, Lee led his army through the Shenandoah Valley for his second invasion of the North, hoping to reach as far as Harrisburg, Pennsylvania, or even Philadelphia, and to influence Northern politicians to give up their prosecution of the war. Prodded by President Abraham Lincoln, Maj. Gen. Joseph Hooker moved his army in pursuit, but was relieved just three days before the battle and replaced by Meade.
The two armies began to collide at Gettysburg on July 1, 1863, as Lee urgently concentrated his forces there. Low ridges to the northwest of town were defended initially by a Union cavalry division, which was soon reinforced with two corps of Union infantry. However, two large Confederate corps assaulted them from the northwest and north, collapsing the hastily developed Union lines, sending the defenders retreating through the streets of town to the hills just to the south.