The president immediately preceding James A. Garfield was Rutherford B. Hayes. Garfield took office in March 1881, following Hayes's presidency, which lasted from 1877 to 1881.