He did not return to command until September, following the Battle of Antietam, when he was given command of a division in the Right Wing of the Army of Northern Virginia, in the command of Major General James Longstreet, which became the I Corps that December. His division was lightly engaged at the Battle of Fredericksburg and, along with most of Longstreet's Corps, missed the Battle of Chancellorsville while participating in the Suffolk Campaign in 1863. During the Gettysburg Campaign, his division was, much to Pickett's frustration, the last to arrive on the field. However, it was one of three divisions under the command of General Longstreet to participate in a disastrous assault on Union positions on July 3, the final day of the battle. The attack has been given the name "Pickett's Charge." In February 1864, Pickett ordered 22 North Carolinians in Union uniform hanged as deserters after a failed assault on New Bern. His military career came to an inglorious end when his division was overwhelmed and defeated at the Battle of Five Forks.