On September 23, 1863, Long was promoted to brigadier general and placed in command of the artillery in Lieutenant General Richard S. Ewell's Second Corps. He was present at both the Bristoe Campaign and the subsequent Mine Run Campaign. Long commanded the artillery through the Overland Campaign, including the battles of the Wilderness, Spotsylvania Court House, and Cold Harbor. During Early's 1864 Shenandoah Valley Campaign he served intermittently as artillery chief for the Army of the Valley, but was often absent due to illness. He returned with the rest of the army to rejoin Lee and the Army of Northern Virginia around Petersburg and Richmond. Suffering from facial Neuralgia, he surrendered with the remnants of Lee's army at Appomattox Court House in April 1865.