William McKinley served as a United States president.
William McKinley Jr. ( January 29 , 1843 -- September 14 , 1901 ) was an American politician and lawyer who served as the 25th President of the United States from March 4 , 1897 until his assassination in September 1901 , six months into his second term . McKinley was the last president to have served in the American Civil War , and the only one to have started the war as an enlisted soldier , beginning as a private in the Union Army and ending as a brevet major .