Before the expiration of his term as senator the Civil War broke out, and in October 1861, he was mustered into the United States volunteer service as lieutenant colonel of the 8th Kansas Volunteer Infantry. Early in 1862 he was appointed provost marshal of Leavenworth and held the position until his regiment was ordered to Corinth, Mississippi in March. There the 8th Kansas Infantry became a part of Maj. Gen. Don Carlos Buell's army, and it remained in the Army of the Cumberland until the close of the war. On November 1, 1862, Martin was promoted to colonel, and a few weeks later was assigned to duty as provost marshal of Nashville, Tennessee, which position he filled until the following June. With his command he took part in the Battle of Perryville; the various engagements of the Tullahoma Campaign; the battle of Chickamauga, where on the second day he was assigned to the command of the Third Brigade, First Division, XX Corps; and in November was present at the siege of Chattanooga and the Battle of Missionary Ridge. With Maj. Gen. William Tecumseh Sherman's army he marched to Atlanta in the memorable campaign of 1864, the line of march being marked by engagements at Rocky Face Ridge, Dalton, Resaca, Kingston, Kennesaw Mountain and various other points. After the fall of Atlanta, Martin's regiment joined in the pursuit of Lt. Gen. John Bell Hood as he marched northward into Tennessee, where it closed its service. During the closing scenes of his military career Martin commanded the First Brigade, Third Division, IV Corps, until he was mustered out at Pulaski, Tennessee on November 17, 1864. He later received a brevet of brigadier general "for gallant and meritorious services", dated March 13, 1865.