Ferdinand was introduced to political duties at an early age. During the Thirty Years’ War, after the murder of the military commander Wallenstein, he was nominally entrusted with command of the imperial forces. His position strengthened by a number of military victories, he was elected Roman King shortly before the death of his father, Ferdinand II. He succeeded him as emperor and endeavoured to bring about peace. Ferdinand was a keen patron of the arts and was the first Habsburg emperor to compose music.