Were there any dictators1 who, after being toppled by a revolution or the like, managed to get back to power via what is (or was considered by the norms applied at the time) free and transparent2 elections ?
It's NOT required that the comeback occurs at the first elections held after the toppling.
To make things even easier :
1 - The ruler must be a dictator (no matter how he got there);
2 - (S)he is ousted after a popular revolution (bloody or not, coups NOT included);
3 - A democratic regime, where elections are free, is established;
4 - N presidents took power, where N = 0, 1, 2, ...;
5 - The ex-dictator is allowed to run for presidency and wins elections.
1 : A dictator is a ruler who maintains a total power over a country. It could be a president in a military regime (North Korea), a president in a pseudo-democratic regime (Prerevolutionary Tunisia, where elections results were known beforehand), a monarch (Saudi Arabia) ...
2 : For the sake of this question, every elections where those, who are allowed to vote, can choose the candidate they want, is considered free and transparent. Here, it doesn't matter if the voters were only males, or from a particular race, etc.