William McKinley was the 25th president of the United States, serving from 1897 until his assassination in 1901.