Confederate soldiers led by General A. P. Hill marched towards Gettysburg to meet up with forces under Confederate General Robert E. Lee. On the way, Hill's troops ran into a couple of brigades of Union calvary under the command of John Buford. Buford had ordered his men to take defensive positions on the hills and ridges surrounding the town. From there, they engaged Hill's troops. The shooting attracted even more troops and each side sent for reinforcements.
The Northern armies, under the command of General George Meade, that were north and west of Gettysburg began to fall back under rebel assault. The Confederates took control of the town. Lee knew, however, that the battle would not be won unless the Northerners were also forced to yield up their positions on Cemetery Ridge, the high ground south of Gettysburg.