In elections that take place in a less-than-perfect democracy, incumbency advantages are different from those in mature democracies. The incumbent can prevent credible challengers from running, organize vote fraud, or even physically eliminate his main opponents. At the same time, formally winning the election does not guarantee staying in power. We present a unified model of elections and mass protests where the purpose of competitive elections is to reveal information about the relative popularity of the incumbent and the opposition. Citizens are heterogenous in their attitudes toward the dictator, and these individual preferences serve as private signals about the aggregate distribution of preferences; this ensures a unique equilibrium for any information the incumbent may reveal. We show that the most competent or popular dictators run in competitive elections, mediocre ones prevent credible opponents from running or cancel elections, and the least competent ones use outright repressions. A strong opposition makes competitive elections more likely but also increases the probability of repression. A totalitarian regime, where repression is cheaper, will have more repression, but even in the absence of repression, competitive elections will be rarer. A crueler, say, military, regime, where protesting is costly, makes repression less likely and, surprisingly, competitive elections more likely.