He won the popular vote for three presidential elections—in 1884, 1888, and 1892—and was one of two Democrats (with Woodrow Wilson) to be elected president during the era of Republican political domination dating from 1861 to 1933. In the 1870s, the municipal government in Buffalo had grown increasingly corrupt, with Democratic and Republican political machines cooperating to share the spoils of political office. In 1881 the Republicans nominated a slate of particularly disreputable machine politicians; the Democrats saw the opportunity to gain the votes of disaffected Republicans by nominating a more honest candidate. The party leaders approached Cleveland, and he agreed to run for Mayor of Buffalo, provided that the rest of the ticket was to his liking.