One of the largest military conflicts in North American history begins on July 1, 1863, when Union and Confederate forces collide at Gettysburg, Pennsylvania. The epic battle lasted three days and resulted in a retreat to Virginia by Robert E. Lee’s Army of Northern Virginia.

Two months prior to Gettysburg, Lee had dealt a stunning defeat to the Army of the Potomac at Chancellorsville, Virginia. He then made plans for a Northern invasion in order to relieve pressure on war-weary Virginia and to seize the initiative from the Yankees. His army, numbering about 80,000, began moving on June 3. The Army of the Potomac, commanded by Joseph Hooker and numbering just under 100,000, began moving shortly thereafter, staying between Lee and Washington, D.C. But on June 28, frustrated by the Lincoln administration’s restrictions on his autonomy as commander, Hooker resigned and was replaced by George G. Meade.

READ MORE: How the Battle of Gettysburg Turned the Tide of the Civil War

Meade took command of the Army of the Potomac as Lee’s army moved into Pennsylvania. On the morning of July 1, advance units of the forces came into contact with one another just outside of Gettysburg. The sound of battle attracted other units, and by noon the conflict was raging. During the first hours of battle, Union General John Reynolds was killed, and the Yankees found that they were outnumbered. The battle lines ran around the northwestern rim of Gettysburg. The Confederates applied pressure all along the Union front, and they slowly drove the Yankees through the town.

By evening, the Federal troops rallied on high ground on the southeastern edge of Gettysburg. As more troops arrived, Meade’s army formed a three-mile long, fishhook-shaped line running from Culp’s Hill on the right flank, along Cemetery Hill and Cemetery Ridge, to the base of Little Round Top. The Confederates held Gettysburg, and stretched along a six-mile arc around the Union position. Lee’s forces would continue to batter each end of the Union position, before launching the infamous Pickett’s Charge against the Union center on July 3.