By June 13, elements of Ewell's corps appeared before Winchester and on June 14-15, Ewell attacked the Federal garrison at Winchester and defeated it. After Winchester, Lee's army moved into the Cumberland Valley of Pennsylvania.
Heth approached until he reached a point about two miles west of Gettysburg then deployed two brigades in line, and moved forward. Federal General John F. Reynolds, commanding I Corps, arrived on the field at this point, and ordered I Corps and Major General Howard's XI Corps to march to Gettysburg.
Soon after I Corps arrived and engaged Heth along McPherson's Ridge. Heth was defeated and forced to withdraw. Reynolds was killed and Howard took command as both sides brought up reinforcements. The Federal I Corps deployed to defend the western approaches to Gettysburg, and XI Corps formed up north of the town. Buford's cavalry covered the flanks. Howard left one division in reserve on Cemetery Hill. The Federal strategy was to delay the Confederates long enough to enable the rest of the Federal army to assemble.
The Federal army was well prepared. Six of its seven corps had arrived on the battlefield overnight and Meade had deployed his army in a fish-hook-shaped formation, with the right on Culp's Hill and Cemetery Hill, the center along Cemetery Ridge, and the left on Little Round Top all commanding positions overlooking the Confederate lines.
On the Federal right, Ewell did not attack until evening, after Longstreet's onslaught had subsided. The effort to storm Cemetery Hill was ultimately unsuccessful. Ewell's attacks were also repulsed at Culp's Hill, although a foothold was gained near the base of the hill.
At l:00 pm, the artillery opened the great bombardment of the Federal line. The Federal army replied and a giant artillery duel shook the ground for nearly two hours. After the bombardment ended, the infantry went forward in an advance that has been known throughout history as "Pickett's Charge”. Federal artillery, firing shotgun like blasts of canister fire, followed by musketry, cut the Confederate formations to pieces and inflicted devastating losses. A small Confederate force reached the Federal line, but was quickly overwhelmed. The attack ended in disaster, with nearly 5,600 Confederate casualties. The battle was effectively over. Federal losses numbered approximately 23,000, while estimates of Confederate losses range between 20,000 and 28,000.