The Battle of Gettysburg was a major turning point in the American Civil War. Over three days of intense fighting in July 1863 near the town of Gettysburg, Pennsylvania, the Union forces were able to stop General Robert E. Lee's Confederate invasion of the North. On the first day, Union cavalry slowed the Confederate advance and secured high ground. The second day saw heavy fighting as the Confederates attacked the Union flanks. On the third and final day, Pickett's Charge, a massive Confederate infantry assault on the Union center, was repulsed with heavy losses, forcing Lee to retreat. The Union victory ended Lee's campaign and put the Confederacy on the defensive for the rest of the war.