The Battle of Gettysburg occurred more or less by accident. Neither General Lee nor General Meade, who replaced Hooker in command only a few days before the battle, had planned to fight there. General Ewell, now commanding Jackson's corps, was headed toward Harrisburg. But some of Lee's troops commanded by A. P. Hill, always on the lookout for provisions, sent a detachment toward Gettysburg. The town was small, but a dozen roads crisscrossed the landscape, and a railroad was under construction.
Ever since Stuart had departed days earlier, Lee had been without his eyes and ears. Thus Lee did not know exactly where the Federals were. He was unaware that the Union 1st Corps under General John Reynolds was approaching Gettysburg from the southeast direction. The Army of the Potomac and the Army of Northern Virginia were about to clash in the largest battle ever fought in America. When a scout reported that the Union army had crossed the Potomac, Lee began concentrating his army.
Union cavalry in the capable hands of General Buford was reconnoitering Southern Pennsylvania in advance of the Union Army, which was making its way along the Baltimore Turnpike. On the morning of July 1 the troopers were passing through Gettysburg when Buford discovered a division of A. P. Hill's Corps under the command of Henry Heth just west of the town. He sent word back to Reynolds of the enemy approach. Buford judged that the high ground around Gettysburg would be good ground on which to fight and decided to take Heth's men under attack. Heavily outnumbered, Buford sent word back to Reynolds, urging him to hurry his corps forward.
Reynolds's 1st Corps and Hill's Corps soon clashed on the northwestern outskirts of the village, while General Ewell was called from his advance towards Harrisburg to join the action at Gettysburg. The arrival of Union General Oliver O. Howard's 11th Corps helped to shift the balance toward the Union, which was outnumbered for much of the day. (The Confederate Corps were larger than those of the Union.) The Union men were driven back through the town of Gettysburg and onto some high ground to the south and east of the town—Culp's Hill and Cemetery Ridge. That's where the fighting ended the first day. For the time being Lee appeared to have the upper hand. The battle, however, was far from over.