In the spring of 1863, the Confederacy found itself in a situation that called for action. The Confederate Army of Northern Virginia, commanded by General Robert E. Lee, had defeated the Union Army of the Potomac at Fredericksburg in December, 1862, and again at Chancellorsville in May, 1863; but the nature of that ground gave Lee little opportunity to follow up his advantage.
"I considered the problem in every possible phase," Lee later explained,"and to my mind, it resolved itself into a choice of one of two things: either to retire to Richmond and stand a siege, which must ultimately have ended in surrender, or to invade Pennsylvania."
In addition to obtaining much needed supplies to continue the
Southern offensive, Lee's invasion had two strategic purposes. The Confederacy hoped that an engagement that resulted in another convincing victory would stir the people of the North to demand peace at any cost.
Lee stated it thus,
"If we can baffle them in their various designs this year, next fall there will be a great change in public opinion at the north.... We have only, therefore, to resist manfully... [and] our success will be certain."
It was also hoped that a victory would persuade Great Britain and other European nations to recognize the new government in the South. Therefore, for nearly two months after the battle of Chancellorsville, the Union and Confederate armies in Virginia maneuvered for position, with Lee concentrating his forces for a thrust into the north. Lee launched his second invasion of the North on June 5, 1863.
Lee's advance elements moved down the Shenandoah valley toward Harpers Ferry, brushing aside small Federal forces near Winchester. Marching through Maryland into Pennsylvania, the Confederates reached Chambersburg and turned eastward. They occupied York and Carlisle and
menaced Harrisburg, where Lee planned to destroy the railroad bridge, then,
"turn my attention to Philadelphia, Baltimore, or Washington as may seem best for our interest."
The three army corps that comprised the Army of Northern Virginia were commanded by Generals James Longstreet, R. S. Ewell, and A. P. Hill. Ewell's corps had threatened Harrisburg, Philadelphia, and Baltimore. On June 30 it lay north of Gettysburg . Hill's corps bivouacked at Cashtown, between Chambersburg and Gettysburg. Longstreet's corps camped at Chambersburg.
The Union, on the other hand, faced its darkest days in the War. A Confederate army with a series of convincing victories behind it was now striking northward into Pennsylvania. The Northern people were panic-stricken. Union General Joseph Hooker followed Lee's advance, moving
the Army of the Potomac parallel to the Confederate line of march, and keeping between Lee's army and the city of Washington. President Abraham Lincoln instructed Hooker to,
"Fight him, too, when opportunity offers. If he stays where he is, fret him and fret him."
Reaching Frederick, Hooker requested that the nearly 10,000-man Federal garrison at Harpers Ferry be added to his field army. When General-in Chief Henry Halleck refused, Hooker resigned his command. New leadership was needed. On June 27, President Lincoln placed General George G. Meade in
command. Meade was granted a greater degree of freedom of movement than Hooker had enjoyed. His main duty would be to cover Washington and Baltimore.
"Should General Lee move upon either of these places, " Halleck instructed, "it is expected that you will either anticipate him or arrive with him so as to give him battle."
With this, Meade carefully felt his way northward, looking for the enemy.
During this time Lee was hampered by the absence of his cavalry, for General J. E. B. Stuart had gone around the Federal Army on a raid and
did not return until too late to be of service. To his surprise, Lee learned from a spy on June 28 that the Federal army was north of the Potomac. He hastened to concentrate his far-flung legions. Without knowing the position of the enemy, Lee converged the three columns of his army on Gettysburg, 7 miles above the Maryland-Pennsylvania boundary.