In the winter of 1861–62, Johnson's army cooperated with Maj. Gen. Thomas J. "Stonewall" Jackson in the early stages of the Valley Campaign. At the Battle of McDowell, Johnson was severely wounded with a bullet to the ankle, which took a long time to heal. He returned to Richmond for his convalescence and remained there for nearly a year, active in the social scene. Although Johnson was a heavy-set, rough-looking, rude character, who was still a bachelor at age 47, he had the reputation of a ladies' man. Due to a wound he received in Mexico, he was afflicted with an eye that winked uncontrollably, causing many women to believe he was flirting with them. He caused enough attention that he rated mentions in the famous diary of Mary Chesnut.
In 1863, following the reorganization of the Army of Northern Virginia to compensate for the death of Stonewall Jackson after the Battle of Chancellorsville, Johnson was promoted to major general and given command of the "Stonewall Division" in Lt. Gen. Richard S. Ewell's Second Corps. Robert E. Lee had become dissatisfied with the previous commander at the battle and summoned Johnson back from medical leave to take the command.
By May 1863, Johnson had recovered enough to lead his division in the Gettysburg Campaign. He still needed a heavy hickory stick to move around on foot (and was known to use it against men he believed were shirking battle) and his men nicknamed him "Old Clubby". On the way north into Pennsylvania, Johnson defeated Union General Robert H. Milroy at the Second Battle of Winchester. Johnson arrived at the Battle of Gettysburg on the evening of the first day, July 1, 1863. In a move that is still controversial, Ewell did not take advantage of Johnson's division and attack Cemetery Hill immediately that evening, when it might have been decisive. Johnson controversially declined to attack Culp's Hill that evening, for which he had a discretionary order. Instead, Johnson's division was the primary force that attacked Culp's Hill on the second and third days, suffering considerable casualties assaulting this impregnable position multiple times with no lasting success. In the fall of 1863, Johnson played a prominent role in the Mine Run Campaign.
In the Overland Campaign of 1864, Johnson fought well at the Battle of the Wilderness and when Lt. Gen. James Longstreet was seriously wounded there, Robert E. Lee considered Johnson as a replacement corps commander. During the Battle of Spotsylvania Court House, on May 12, 1864, at the "Bloody Angle" section of the Confederate "Mule Shoe" defensive line, Johnson was captured along with most of his division. He was imprisoned for months at Morris Island, off the coast of Charleston, South Carolina, and was exchanged on August 3, 1864. He was sent west to join Lt. Gen. John Bell Hood's Army of Tennessee, where he commanded a division in the corps of Lt. Gen. Stephen D. Lee. During the Franklin-Nashville Campaign, Johnson was captured again at the Battle of Nashville on December 16, 1864. He again spent months in a Union prisoner of war camp at Johnson's Island, in Lake Erie. At the end of the war, Johnson was moved to the Old Capitol Prison in Washington, D.C., where he was accused of being somehow complicit in the assassination of Abraham Lincoln. Nothing came of the accusation and he was paroled on July 22, 1865.