He enlisted in the 3rd Ohio Infantry, a three-months regiment, being appointed major. He served in western Virginia fighting in the battles of Rich Mountain and Cheat Mountain and afterward was promoted to lieutenant colonel of the regiment. When his term expired, he joined the 110th Ohio Infantry and became its colonel. He served in the Eastern Theater leading his regiment at the second battle of Winchester. While the Union army was soundly defeated and most of it surrendered, Keifer's regiment was able to avoid capture. Following the battle of Gettysburg, Keifer was assigned to brigade command in the III Corps and fought at the battle of Wapping Heights. After Robert E. Lee's army had retreated to safety in Virginia, Keifer and his regiment were dispatched to New York City to help suppress the draft riots.