James A. Garfield ran for president in 1880 as the Republican nominee. He defeated Democrat Winfield Scott Hancock in the general election and served as the 20th president of the United States from March 1881 until his assassination later that year.