Albert was a son of Albert III, Duke of Bavaria and Anna of Brunswick-Grubenhagen-Einbeck. After the death of his older brother John IV, Duke of Bavaria he gave up his spiritual career and returned from Pavia to Munich. When his brothers Christoph and Wolfgang had resigned Albert became sole duke, but a new duchy Bavaria-Dachau was created from Bavaria-Munich for his brother Duke Sigismund in 1467. After Sigismund's death in 1501, it reverted to Bavaria-Munich. The marriage of Kunigunde of Austria to Albert IV, was a result of intrigues and deception, but must be counted as a defeat for Emperor Frederick III. Albert illegally took control of some imperial fiefs and then asked to marry Kunigunde, offering to give her the fiefs as a dowry. The Emperor agreed at first, but after Albert took over yet anotherfief, Regensburg, Emperor Frederick III withdrew his consent. On January 2, 1487, however, before the Emperor's change of heart could be communicated to his daughter, Kunigunde married Albert. A war was prevented only by intermediation by the Emperor's son, Maximilian I. For Albert's wedding, Grünwald Castle was extended in 1486/87 under the direction of Jörg von Weikertshausen. Albert finally decided to return territorial acquisitions in Swabia in 1492 to avoid a war with the Habsburg and the Swabian League. He then also had to release Regensburg, which had been reunited with Bavaria in 1486, and had to reluctantly renounce Further Austria when Archduke Sigismund of Austria tried to make it over to Albert. After the death of the last duke of Bavaria-Landshut, George in 1503, Albert managed to reunite the whole of Bavaria in a dreadful war against George's heirs, the Palatinate line of his Wittelsbach family but had to transfer the most southern districts of Bavaria-Landshut to his brother-in-law Emperor Maximilian as compensation for his support: Kufstein, Kitzbühel and Rattenberg passed to Maximilian in 1506 and were united with Tyrol. For the Palatinate branch a new duchy of Palatinate-Neuburg was created. To avoid any future division of Bavaria, Albert decreed the everlasting succession of the firstborn prince in 1506. Nevertheless, his oldest son and successor William IV, Duke of Bavaria had to share his power from 1516 onwards with his younger brotherLouis X, Duke of Bavaria. After the death of Louis X in 1545, the edict became effective until the end of Bavarian monarchy in 1918. Albert is buried in the Frauenkirche in Munich.