 By the Treaty of Schönbrunn of 1809, Salzburg temporarily became French and was released in 1810 to the Kingdom of Bavaria, where it formed the "Salzachkreis".After the end of the Napoleonic Wars and the 1816 Treaty of Munich, the Salzburg lands came back to Austria, with the exception of the share on the left bank of the Salzach river, the so-called "Rupertiwinkel", which, like the former Prince-Provostry of Berchtesgaden, remained in Bavaria.Some smaller areas in the Ziller and Defereggen valleys fell to Tyrol; the town of Friesach was ceded to Carinthia.