Quick Facts. William McKinley was President of the United States from 1896 until 1901, the fifth and last Civil War veteran to occupy the office. He began his military career in June 1861 as a private in the 23rd Ohio Infantry and after commendable service, ended it a brevet major.