In 1861, Gordon was elected as captain of a company of Confederate cavalry. He served with the Army of Northern Virginia. He was wounded just prior to the Battle of Antietam, however, in November 1862, he was promoted to brigadier general. His service at the Battle of Wilderness earned him name recognition in May 1864, after which he was promoted to major general. He was sent out to the Shenandoah Valley during the summer of 1864. During the retreat from Petersburg, he was in command of half of the cavalry until the point of surrender at Appomattox.