In August 1862, Reilly joined the military, accepting an appointment as the colonel of the 104th Ohio Infantry. After training at Camp Massillon, he and his men were assigned to various garrisons and posts in Kentucky, where they operated against Edmund Kirby Smith and John Hunt Morgan. Reilly and the regiment moved to Covington, Kentucky, on September 1, 1862, in preparation for the Defense of Cincinnati against a threatened Confederate invasion by troops under Kirby Smith. Reilly was then involved in the subsequent Skirmish at Fort Mitchell in northern Kentucky. In the summer of 1863, Reilly's 104th OVI was assigned to Maj. Gen. Ambrose Burnside's Army of the Ohio during its campaign in East Tennessee, including operations around the Cumberland Gap. They marched to Knoxville and joined the XXIII Corps. In the autumn of 1863, Reilly commanded a brigade of infantry in the XXIII Corps during the Siege of Knoxville. The following year, he led his brigade with competence during the Atlanta Campaign. On July 30, 1864, Reilly was promoted to brigadier general of volunteers. Assigned command of the 3rd Division, XXIII Corps previously commanded by Jacob D. Cox, he performed well during the Franklin-Nashville Campaign. During the Battle of Franklin, his troops initially broke in disarray under a heavy Confederate assault, but General Reilly managed to rally them and repulse the attack, capturing more than 1,000 prisoners and seizing 22 Confederate battle flags. Reilly and his men were assigned in 1865 to the forces of Maj. Gen. John Schofield and participated in the Carolinas Campaign. He resigned from the army on April 20, 1865, and returned to Ohio.
Postbellum career
Reilly resumed his legal career in Wellsville and became active in community affairs. He remained a force in local politics and helped support numerous Republican candidates. In 1873, he was a delegate to the Ohio stateconstitutional convention from Columbiana County. He died in Wellsville at the age of 77 and was buried in its St. Elizabeth's Cemetery. Upon death, his estate was awarded to the State of Ohio. There is a stadium and grade school in Salem, Ohio that was funded from part of his estate and bear his name to this date.