On May 31 of 1862 the Confederate army attacked and nearly defeated federal forces at Seven Pines, but the Union pulled through with some last-minute reinforcements. Confederate commander Joseph E. Johnston was wounded, and command of the Army of Northern Virginia fell to Robert E. Lee. See also The Peninsular Campaign.