Within 40 years, Braunau changed hands three times: In 1779, it became an Austrian town under the terms of the Treaty of Teschen, which settled the War of the Bavarian Succession. During War of the Third Coalition, the Nuremberg bookseller Johann Philipp Palm was arrested at the Braunau fortress by French troops and executed for high treason by personal order of Napoleon in 1806. Under the terms of the 1809 Treaty of Schönbrunn, Braunau became Bavarian again in 1809. In 1816, during reorganisation of Europe after the Napoleonic Wars at the Congress of Vienna, the Kingdom of Bavaria ceded the town to the Austrian Empire and was compensated by the gain of Aschaffenburg. Braunau has been Austrian ever since.