He served in the Union Army during the Civil War as a field officer in one of Ohio's three-year infantry regiments. In August 1861, Governor William Dennison appointed Swayne as major of the 43rd Ohio Volunteer Infantry Regiment, which was being organized in Mount Vernon, Ohio. He fought at the battles of Iuka and Corinth, and was promoted to fill the vacancy caused by the death of the regiment's colonel.