 In 1865, he ran for District Attorney, losing narrowly to his friend and roommate, Lyman K. Bass, the Republican nominee.In 1870, with the help of friend Oscar Folsom, Cleveland secured the Democratic nomination for Sheriff of Erie County, New York.He won the election by a 303-vote margin and took office on January 1, 1871 at age 33.