At Chancellorsville, Johnston was given command of the 12th North Carolina Infantry, after that unit had lost all of its field officers. He returned to the 23rd for the Gettysburg Campaign and was wounded at the Battle of Gettysburg. He was promoted to brigadier general on September 1, 1863, and was given command of the brigade that Brig. Gen. Alfred Iverson, Jr., had commanded at Gettysburg. He commanded the brigade through the Overland Campaign in the spring of 1864 until he suffered his third wound at Spotsylvania. He returned to the brigade in August during Lt. Gen. Jubal A. Early's Shenandoah Valley Campaign. In that campaign he saw action at the Third Battle of Winchester, the Battle of Fisher's Hill, and the Battle of Cedar Creek. Along with the rest of Early's army, he returned to the Petersburg trenches to rejoin Gen. Robert E. Lee's Army of Northern Virginia. During his time at Petersburg, Johnston briefly commanded the division and served on detached duty attempting to catch deserters.