Stewart joined the United States Army as a private in 1851. Continuously serving in 4th U.S. Light Artillery, Battery B; by late 1861 he was its first sergeant.[1] Battery commander John Gibbon, soon to become a major general, described Stewart as "the best first sergeant I ever saw in the service.".[3] In November 1861 he was commissioned as Second Lieutenant. At the Battle of Antietam, his artillery battery was first deployed due east of the D. R. Miller house, north of the Cornfield, helping to stop Jackson's men. Later they moved to the west side of the Hagerstown pike, due west of the Cornfield and were engaged against Hood's Division. The battery lost 40 of 100 engaged while in this position. When the commanding officer Captain Joseph B. Campbell was wounded, Stewart took command.[1] Stewart commanded the battery, the only regular artillery in the I Corps, during the Battle of Gettysburg. This battery also suffered the highest overall casualty figure of any I Corps battery.[3] During the first day of fighting at Gettysburg, Stewart was placed west of the Thompson House, supported by the Sixth Wisconsin, plus the 11th and 143rd Pennsylvania regiments.[4][5] On August 1, 1864, he was brevetted captain for "gallant services at the Battle of Spotsylvania Court House and during the present campaign before Richmond..."[6]
After the war he remained in the Regular Army, being transferred to the 18th U.S. Infantry Regiment. He retired as a Major in 1879.[1]