As commanding general of the army, Grant confronted Robert E. Lee in a series of very bloody battles in 1864 known as the Overland Campaign that ended with the bottling up of Lee at Petersburg , outside the Confederate capital of Richmond.