In September 1861, Miles recruited a company of volunteers and received a commission as captain, September 1861; served on General Oliver O. Howard's staff and was wounded at the Battle of Fair Oaks; was promoted to lieutenant colonel, 61st New York Volunteer Infantry, for gallantry in action, May 1862; replaced his seriously wounded commander at the Battle of Antietam and was promoted to colonel, September 1862; was again wounded in the Battle of Fredericksburg, 1862; was again wounded at the Battle of Chancellorsville, 1863, where his gallant conduct later was recognized with the brevet of brigadier general (1867) and the Medal of Honor (1892); received the thanks of Congress for his conduct in the battles of the Wilderness and Spotsylvania, suffered slight wounds at the battle of Petersburg, and was appointed brigadier general of volunteers, May 1864; received his promotion to major general of volunteers, October 1865; commanded the District of Fort Monroe with supervision over Confederate President Jefferson Davis confined there.