The Duchy of Bavaria (German: Herzogtum Bayern) was a frontier region in the southeastern part of the Merovingian kingdom from the sixth through the eighth century.
During internal struggles in the Ottonian dynasty, the Bavarian territory was considerably diminished by the separation of the newly established Duchy of Carinthia in 976.
In the final conflict between the Welf and Hohenstaufen dynasties, Duke Henry the Lion was banned and deprived of his Bavarian and Saxon fiefs by Emperor Frederick Barbarossa.
The medieval Bavarian stem duchy covered present-day Southeastern Germany and most parts of Austria along the Danube river, up to the Hungarian border which then ran along the Leitha tributary in the east.
In his Getica, the chronicler Jordanes writes: "That area of the Swabians has the Bavarii in the east, the Franks in the west ..." Until the end of the first duchy, all rulers descended from the family of the Agilolfings.
At around 743, the Bavarian duke Odilo vassalised the Slavic princes of Carantania (roughly corresponding with the later March of Carinthia), who had asked him for protection against the invading Avars.
In 798, Pope Leo III created the Bavarian ecclesiastical province with Salzburg as metropolitan seat and Regensburg, Passau, Freising, and Säben (later Brixen) as suffragan dioceses.
With the rise of the Frankish Empire under the Carolingian dynasty, the autonomy of the Bavarian dukes, previously enjoyed under the Merovingians, was reduced and subsequently terminated.
In 716, the Carolingians had incorporated the Franconian lands in the north, formerly held by the Dukes of Thuringia, whereby the bishops of Würzburg gained a dominant position.
The last tribal stem duchy to be incorporated was Bavaria in 788, after Duke Tassilo III had tried in vain to maintain his independence through an alliance with the Lombards.
Already in 788, the Avars made an incursion into Bavaria, but Franko-Bavarian forces repelled them, and then launched a counterattack towards neighbouring Avarian regions, situated along the river Danube, east of the Enns.
In Regensburg, he held a council and regulated issues regarding the Bavarian frontier counties (marches),[4] thus preparing the basis for future actions in the east.
[6] Frankish acquisition of new eastern regions, particularly those between the river Enns and the Vienna Woods, represented a significant gain for the security of Bavaria.
When the brothers divided the Empire by the 843 Treaty of Verdun, Bavaria became part of East Francia under King Louis the German, who upon his death bequested the Bavarian royal title to his eldest son Carloman in 876.
During the reign of Louis the Child, Luitpold, Count of Scheyern, who possessed large Bavarian domains, ruled the Mark of Carinthia, created on the southeastern frontier for the defence of Bavaria.
He died in the great battle of 907, but his son Arnulf, whose last name was the Bad, rallied the remnants of the tribe in alliance with the Hungarians and became duke of the Bavarians in 911, uniting Bavaria and Carinthia under his rule.
At the same time, East Francia was exposed to the rising threat from Hungarian invasions, especially in the Bavarian March of Austria (marchia orientalis) beyond the Enns river.
The last attempt of the Luitpoldings to regain power by joining the rebellion of King Otto's son Duke Liudolf of Swabia was crushed in 954.
The Magyars retreated behind the Leitha and Morava rivers, facilitating a second wave of German Ostsiedlung into the areas of today's Lower Austria, Istria and Carniola.
Though Henry II reconciled with Emperor Otto's widow Theophanu in 985 and regained his duchy, the power of the Bavarian dukes was further diminished by the rise of the Franconian House of Babenberg, ruling as Margraves of Austria (Ostarrichi), who became increasingly independent.
At different times, the duchy was ruled by the German kings in personal union, by dependent dukes, or even by the emperor's sons, a tradition maintained by Henry's Salian successors.
The newly gained areas of Brandenburg (1323), Tyrol (1342), the Dutch provinces Holland, Zeeland and Friesland and the Hainaut (1345) were, however, lost under his successors.
William followed the traditional Wittelsbach policy of opposition to the Habsburgs until in 1534 he made a treaty at Linz with Ferdinand I, the king of Hungary and Bohemia.
This link strengthened in 1546, when the emperor Charles V obtained the help of the duke during the war of the league of Schmalkalden by promising him in certain eventualities the succession to the Bohemian throne, and the electoral dignity enjoyed by the count palatine of the Rhine.
Early in his reign Albert made some concessions to the reformers, who were still strong in Bavaria; but about 1563 he changed his attitude, favoured the decrees of the Council of Trent, and pressed forward the work of the Counter-Reformation.
The finances and the judicial system were reorganised, a class of civil servants and a national militia founded, and several small districts were brought under the duke's authority.