During the War of the Spanish Succession, the castle was again besieged by Bavarian troops under Elector Maximilian II Emanuel in 1703, nevertheless the Austrian domains were confirmed by the Treaty of Ilbersheim the next year. After the War of the Third Coalition, Kufstein once again was awarded to the newly established Kingdom of Bavaria in the 1805 Peace of Pressburg and the Tyrolean Rebellion of 1809 was crushed by the Bavarian Army. Finally in 1813/14 it passed to the Austrian Empire.