An active supporter of the French Revolution, he served brilliantly under Napoleon I in the Italian Campaign. At one time a rival to Napoleon, he nevertheless supported the latter when he proclaimed the empire in 1804. He fought at Austerlitz and Wagram and became governor of Hanover before being invited (1810) by the Swedish Riksdag (Parliament) to succeed the senile, childless Charles XIII. He accepted, becoming a member of the Lutheran Church. As crown prince he allied Sweden with Britain and Russia and played an important part in the defeat of Napoleon at the battle of Leipzig (1813). Having invaded Denmark, he obtained Danish agreement at the Treaty of Kiel (1814) for the transfer of Norway to Sweden. He succeeded Charles XIII in 1818. Autocratic in style and opposed to demands for a free press and more liberal government, he nevertheless maintained popular support throughout his reign. He was the founder of the present Swedish dynasty.