Robert E. Lee invaded Pennsylvania in June 1863. He was hoping to threaten Washington and Philadelphia, to breed Northern morale, and to gain recognition and independence for the Southern Confederacy. At Gettysburg, Pennsylvania, Lee's Army of Northern Virginia met the Army of the Potomac. It was under the command of General George G, Meade. This famous battle lasted three days.