Gibbon was back in command of the 2nd Division during Gen. Grant's Overland Campaign in May and June 1864, seeing action at the battles of the Wilderness, Spotsylvania Court House, and Cold Harbor. On June 7, 1864, he was promoted to major general of volunteers. During the subsequent Siege of Petersburg campaign (June 1864 to April 1865), Gibbon became disheartened when his troops refused to fight at Ream's Station in August 1864. He briefly commanded the XVIII Corps before going on sick leave, but his service being too valuable, he returned to command the newly created XXIV Corps in the Army of the James. His troops helped achieve the decisive breakthrough at Third Battle of Petersburg in April 1865, capturing Fort Gregg, part of the Confederate defenses. During the Appomattox Campaign, he helped block the Confederate escape route at the Battle of Appomattox Courthouse, resulting in Gen. Lee's surrender. He was one of three commissioners for the Confederate surrender.