In 1861, Mahone was the president and superintendent of the Norfolk & Petersburg railroad. He was appointed colonel of the 6th Virginia Infantry. He served in the Norfolk area of Virginia, and helped to erect defenses during the Battle of Drewry's Bluff. He served with the Army of Northern Virginia at the battle of Seven Pines until the surrender at Appomattox Court House. As early as November 1861, he rose to the rank of brigadier general, however, it was not until his service at the siege of Petersburg that he advanced to the rank of major general. After the war, he returned to serve the Petersburg & Norfolk railroad.