Hayes also served in the military in the Spanish–American War, Philippine–American War and First World War. He was a member of the First Cleveland Troop, later known as Troop A of the Ohio National Guard. During the Spanish–American War, he was appointed a major in the First Ohio Cavalry. He fought in Santiago de Cuba Campaign, during which he was wounded during the crossing of the San Juan River and the assault on San Juan Hill, and later in the invasion of Puerto Rico.