After 25 years as a civilian, he rejoined the Army to fight in the American Civil War. Despite his age, he quickly rose up the ranks and was appointed a brigadier general in early 1862. During the war, he took part in the Northern Virginia Campaign, the Battle of Antietam, and the Battle of Chancellorsville. His most notable contribution during the war was his defense of the Union right flank at Culp's Hill during the Battle of Gettysburg. He returned to engineering work after the war until his death in 1899.