The nephew of Napoleon I, Louis Napoleon spent his youth with his mother, Hortense de Beauharnais, in Switzerland and Germany and became a captain in the Swiss army. Animated by a mixture of liberalism and Bonapartism, he indulged (1830–31) in revolutionary activities in Italy. In 1836 he attempted a ludicrous military coup at Strasbourg and was exiled to the United States by the government of Louis Philippe. He managed to return to Switzerland, but French protests at his proximity finally caused him to depart (1838) for England.
In 1840 he again attempted an insurrection, this time at Boulogne-sur-Mer. He was tried and sentenced to life imprisonment. Detained in the fortress of Ham, Somme department, he wrote letters, pamphlets, and books, among them a mildly socialistic work on the extinction of pauperism. He made an easy escape in 1846, walking out disguised as a laborer, and went to England.