After the victory at Chancellorsville, Lee determined on further action. Leaving Fredericksburg he marched north behind the mountains and presently found himself in Pennsylvania. Hooker, when he learned of this move, wanted to crush the rear of Lee, and then march on Richmond thus preventing this Northern raid, but he was commanded from Washington to keep between that city and the enemy. He accordingly moved north with the mountains between the enemy and the army of the Potomac. Balked in his plans he resigned and Meade was made the commander. Seeing Meade somewhat in his rear Lee moved back a little, and on June 30th, 1863, the armies lay almost opposite each other, each a few miles from Gettysburg which was between them.
On the following day the Federal cavalry and Reynold's corps, having moved forward somewhat, passed through the town and encountered some of the advancing enemy. As the Confederates were gradually concentrating on the town they drove this and an additional corps through Gettysburg, and at night the Federal troops occupied a strong position called Cemetery Ridge, south of the town. Shaped like a fish hook, this ridge was ended by two knolls, Culps on the right and Round Top on the left. The rest of the army was hurried up during the night and at dawn was stretched from Culps almost to Round Top.
Lee's army had now taken position in a wide semi-circle outside of this ridge, stationed largely on a parallel ridge called Seminary Ridge. His army was impatient, and Lee determined to attack. Longstreet drove in an advanced angle of the Federal line near Round Top, and almost gained that important hillock. On the other end of the line Ewell and Johnson made an attack near Culps, and at evening the latter general was on that eminence. A portion of the Federal line near the centre had also been broken through for a time. This condition of affairs much encouraged the Confederates; but they had not won yet. During the second night the Federal forces were strengthened in the weak places, and a plan was made to drive Johnson from his advantageous position at Culps.
Day dawned, and the armies for the third time faced each other at close quarters. After a hard struggle Johnson was driven back and the right of the line restored. But the afternoon was to see the great work of the day, the final attempt of Lee to break Meade's army. The place selected for an attack was the centre of the line. After a fire of artillery, to demoralize the Federal troops, the Confederates advanced. 14,000 men, led by Pickett, Wilcox and Pettigrew, rushed forward. They got separated, and not supporting each other, all were captured or compelled to retreat. This last attack had failed, and the battle was ended. Lee, after he began to retreat, was not followed up closely enough by Meade, and escaped again into Virginia.