The Gettysburg Campaign was a series of battles fought in June and July 1863, during the American Civil War. After his victory in the Battle of Chancellorsville, Confederate General Robert E. Lee's Army of Northern Virginia moved north for offensive operations in Maryland and Pennsylvania. The Union Army of the Potomac, commanded by Maj. Gen. Joseph Hooker and then (from June 28) by Maj. Gen. George G. Meade, pursued Lee, defeated him at the Battle of Gettysburg, but allowed him to escape back to Virginia.