Louis-Napoléon Bonaparte (born Charles-Louis Napoleon Bonaparte) was the only President (1848–52) of the French Second Republic and, as Napoleon III, the Emperor (1852–70) of the Second French Empire. He was the nephew and heir of Napoleon I. He was the first President of France to be elected by a direct popular vote. He was blocked by the Constitution and Parliament from running for a second term, so he organized a coup d'état in 1851 and then took the throne as Napoleon III on 2 December 1852, the forty-eighth anniversary of Napoleon I's coronation. He remains the longest-serving French head of state since the French Revolution.
Beginning in 1866, Napoleon had to face the mounting power of Prussia, as Chancellor Otto von Bismarck sought German unification under Prussian leadership. In July 1870, Napoleon entered the Franco-Prussian War without allies and with inferior military forces. The French army was rapidly defeated and Napoleon III was captured at the Battle of Sedan. The French Third Republic was proclaimed in Paris, and Napoleon went into exile in England, where he died in 1873.