With the revolt of duke Henry the Quarrelsome in 976, Bavaria lost large territories in the south and south east. The territory of Ostarrichi was elevated to a duchy in its own right and given to the Babenberger family. This event marks the founding of Austria.
The last, and one of the most important, of the dukes of Bavaria was Henry the Lion of the house of Welf, founder of Munich, and de facto the second most powerful man in the empire as the ruler of two duchies. When in 1180, Henry the Lion was deposed as Duke of Saxony and Bavaria by his cousin, Frederick I, Holy Roman Emperor (a.k.a. “Barbarossa” for his red beard), Bavaria was awarded as fief to the Wittelsbach family, counts palatinate of Schyren (“Scheyern” in modern German). They ruled for 738 years, from 1180 to 1918. The Electorate of the Palatinate by Rhine (Kurpfalz in German) was also acquired by the House of Wittelsbach in 1214, which they would subsequently hold for six centuries.