The revolution of 1848 meant the end of king Louis Philippe's rule.
The Second Republic was declared, and its Constitution gave much power to a directly elected President.
When the election for the Presidency was held in late 1848, Louis Napoleon put forward his candidacy and he went on to win the election, becoming the Republic's President.