Rise to power
The northern and western German princes demanded a new emperor, choosing Otto of Brunswick, mainly under the encouragement of Pope Celestine III, while the southern and eastern German princes remained loyal to the Hohenstaufen. While it was true that Emperor Henry was still alive when his young son Frederick II was elected king at two years of age, he had no way of knowing that his son would become challenged by such a force. The only force that could counter the north and west German's choice was Henry's brother Philip who had initially considered being regent, but was refused that right as the south and east Germans needed an acting king; and Frederick II was too young. Because of all that, it resulted in a double-election in 1198. That same year, Louis's old nemesis, Albert III of Bogen, had died. Thus leaving him with one less problem and one great opportunity.
Louis married the widowed Ludmilla of Bohemia in 1204 to gain the alliance of her uncle King Ottokar I of Bohemia. This also gave him claim to the lands of Albert III of Bogen (brother-in-law of King Ottokar I), if at least not directly. That same year, the Margraviate of Vohburg passed to Louis as well.
An old story goes that the Duke made the acquaintance of Ludmilla of Bohemia with affection and she fearing he did it to delude her, hid three persons she trusted behind a curtain and gave them three pictures to hold up. This done, she begged of him to see her no more unless he promised to marry her before witnesses. The Duke hesitated and she pointed to the three pictures saying,"Those said persons should be witnesses to your promises." Louis, thinking those persons could never rise in judgement against him, made her all the protestations she could desire, so she drew back the curtains and revealed the three living witnesses. He was so taken with the contrivance that he solemnly married her afterwards.
The margraves of Cham died without heirs in 1204 which resulted in major areas given to Louis by King Philip; however, the March of the Nordgau was left as an imperial fief. With this new wealth of land, Louis founded Landshut and began the building of Trausnitz Castle there that same year. The castle was completed by the time of Emperor Frederick II's visit later in 1235.
By the month of June 1208, the many lords of the Empire were gathering with King Philip at Bamberg, the seat of the Prince-Bishopric of Bamberg, to celebrate the wedding of his niece, Beatrice II, Countess of Burgundy, with Otto I, Duke of Merania. The ceremony was headed by Ekbert, Bishop of Bamberg of the House of Andechs (brother of the groom Otto) and Henry II, Margrave of Istria who also was in attendance. After the ceremony, King Philip retired to his quarters, where there, on 21 June 1208, he was murdered by Otto VIII, Count Palatine of Bavaria, Louis's first cousin. The killer evaded the king's guards and fled the city. The lords were immediately called for a court assembly, and they blamed the house of Andechs for the murder of the King. Whether they had a hand in it directly is under debate, but that it happened under their watch is not; they were at least guilty of connivance, with Louis suspecting Henry II of Istria the most. All Andechs were banned from their lands, minus Otto I of Merania and Beatrice his bride who were both regarded as blameless. Thus, an old ally of Bavaria became an enemy overnight. Louis left Bamberg immediately, roused his army, and seized the March of Istria.
After King Philip's murder, Louis did not immediately support the Welf King Otto IV, but rather ran a new king's election in Bavaria under his influence in which he would decide whom he would support. Ultimately, like many others, to secure his accomplishments - and those of his family - he made deals with King Otto IV which granted him the imperial fiefs of the Andechs, assured succession of the Palatinate of the Rhine towards him, and confirmed the everlasting reign of the Wittelsbach family in Bavaria.
Nonetheless, in 1211, Louis joined the Hohenstaufen party again; King Frederick II rewarded him with the Palatinate of the Rhine in 1214: Louis's son Otto II was married to Agnes of the Palatinate, a granddaughter of Duke Henry the Lion and Conrad of Hohenstaufen. With this marriage, the Wittelsbach inherited the Palatinate and ultimately kept it as a Wittelsbach possession until 1918. Since that time also, the lion has become a heraldic symbol in the coat of arms for Bavaria and the Palatinate.