His early years were spent at the courts of his grandfather and father. In 814, when his older brothers
Lothair and
Pepin were designated to govern
Bavaria and
Aquitaine, Louis was still very young. In 817, his father, emperor Louis the Pious issued
Ordinatio Imperii, and assigned titles and regions to his sons, making Lothair co-emperor, Pepin king in Aquitaine, and Louis king in Bavaria, with additional jurisdiction over
Carantania,
Bohemia and other dependent
Slavs and
Avars. Such political solutions were following the practice of emperor Charlemagne of bestowing regional realms to a close family members who would serve as his lieutenants and local governors. Louis ruled over Bavaria and its dependencies from
Regensburg, the old capital of the
Bavarians. Since he was young, during the first several years Louis ruled in assistance with able royal administrators. In 825, he became involved in wars with the
Sorbs and other
Polabian Slavs (known to Franks as
Wends) on north-eastern frontiers. In 827, he married
Hemma, sister of his stepmother
Judith of Bavaria, both daughters of count
Welf, whose possessions ranged from
Alsace to Bavaria. In the same year (827),
Bulgarians invaded Pannonia, thus initiating the start of a Frankish–Bulgarian conflict in the region. In 828, the vast
Duchy of Friuli was divided into four counties, with
Friuli proper and
Istria remaining under jurisdiction of Lothair's Italian realm, while
Carniola and
Lower Pannonia were added to the jurisdiction of Louis' Bavarian realm. At the same time, the question of effective rule over
Carantania was also resolved in Louis' favor. Thus, young king of Bavaria became ruler of entire Frankish southeast, which included Bavaria and Carantania with all eastern
marches and dependent Avar and Slavic regions throughout
Pannonia. In 828 and 829, Louis undertook two campaigns against the Bulgarians who were invading Pannonia, and secured victory by repelling the invaders. During his time as
Unterkönig (sub-king), he tried to extend his rule to the Rhine-Main area. ==Rebellious son==