He was the eldest son of Louis the German, king of East Francia, and Hemma, daughter of a Bavarian count. His father appointed him margrave of Pannonia in 856, and upon his father's death in 876 he became King of Bavaria. He was appointed by King Louis II of Italy as his successor, but the Kingdom of Italy was taken by his uncle Charles the Bald in 875.