Hayes served with the 23rd Regiment of Ohio Volunteer Infantry. He was injured at the Battle of South Mountain Sept. 14, 1862. He was promoted to brigadier general in October 1864 and brevetted major general.