In 1899, he was elected to the Ohio State Senate; he spent four years there, then was elected lieutenant governor. He was defeated for governor in 1910, but was elected to the U.S. Senate in 1914. He ran for the Republican nomination for president in 1920, and he was considered a long shot until after the convention began. He won in a landslide over Democrat James M. Cox and the then-imprisoned Socialist Party candidate Eugene Debs and became the first sitting senator to be elected president. Harding appointed a number of well-regarded figures to his cabinet, including Andrew Mellon at Treasury, Herbert Hoover at the Department of Commerce, and Charles Evans Hughes at the State Department. His cabinet members Albert B. Fall (Interior Secretary) and Harry Daugherty (Attorney General) were each later tried for corruption in office; these and other scandals greatly damaged Harding's posthumous reputation. Harding died of a heart attack in San Francisco while on a western tour and was succeeded by Vice President Calvin Coolidge.